#include<iostream>
using namespace std;
int abssub(int a, int b)
{
	if (a > b) return a - b;
	else return b - a;
}
bool exist(char c1, char c2, int a1, int a2)
{
	if (a1 == a2 || abssub(a1, a2) == 1) return true;
	else return false;
}
void pr(char c1, char c2, int a1, int a2)
{
	if(a1==a2||a1>a2)
		for (int i = 0; i < a1 + a2; i++)
		{
			if (i % 2 == 0)
				cout << c1;
			else
				cout << c2;
		}
	else if(a1<a2)
		for (int i = 0; i < a1 + a2; i++)
		{
			if (i % 2 == 0)
				cout << c2;
			else
				cout << c1;
		}
}
int main()
{
	char c1, c2;
	int a1, a2;
	cin >> c1 >> c2;
	cin >> a1 >> a2;
	if (!exist(c1,c2,a1,a2))
		cout << "nemoguce";
	else
		pr(c1, c2, a1, a2);
}