#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	char c1,c2;
	long long a1,a2;
	cin>>c1>>c2;
	cin>>a1>>a2;
	if(abs(a1-a2)>=2) cout<<"nemoguce"<<endl;
	else
	{
		if(a1>a2)
		{
			int brojac=1;
			while(brojac<=a2)
			{
				cout<<c1<<c2;
				brojac++;
			}
			cout<<c1;
		}
		else if(a2>a1)
		{
			int brojac=1;
			while(brojac<=a1)
			{
				cout<<c2<<c1;
				brojac++;
			}
			cout<<c2;
		}
		else
		{
			int brojac=1;
			while(brojac<=a1)
			{
				cout<<c2<<c1;
				brojac++;
			}
		}
	}
}