#include <iostream>
#include <string>

using namespace std;

int main()
{
	int a1, a2, i;
	string in, c1, c2;
	cin>>in;
	c2=in.at(1);
	c1=in.at(0);
	cin>>a1>>a2;
	if(a1==a2)
	{
		for(i=0;i<a1+a2;i++)
		{
			if(i%2==0)
			{
				cout<<c1;
			}
			else
			{
				cout<<c2;
			}
		}
	}else if(a1+1==a2)
	{
		for(i=0;i<a1+a2;i++)
		{
			if(i%2==0)
			{
				cout<<c2;
			}
			else
			{
				cout<<c1;
			}
		}
	}else if(a1-1==a2)
	{
		for(i=0;i<a1+a2;i++)
		{
			if(i%2==0)
			{
				cout<<c1;
			}
			else
			{
				cout<<c2;
			}
		}
	}
	else
	{
		cout<<"nemoguce";
	}
	return 0;
}