#include <iostream>
using namespace std;
main()
{
	int a1,a2,br1,br2,i,j;
	char c1,c2;
	string s;
	cin>>c1;
	cin>>c2;
	cin>>a1;
	cin>>a2;
	br1=a1;
	br2=a2;
	if((a1-a2<2)&&(a2-a1<2))
	{
		if(a1>=a2)
		{
			if(a1>a2)
			{
				s=c1;
				while(br1!=1)
				{
					br1--;
					s+=c2;
					s+=c1;
				}
				cout<<s;
			}
			else
			{
				while(br1!=0)
				{
					br1--;
					s+=c2;
					s+=c1;
				}
				cout<<s;
			}
		}
		else
		{
			s=c2;
			while(br2!=1)
			{
				br2--;
				s+=c1;
				s+=c2;
			}
			cout<<s;
		}
	}
	else
	{
		cout<<"nemoguce";
	}
}