#include <iostream>
#include <cmath>
using namespace std; 

int main ()
{
	string s;
	int a1, a2;
	cin>>s;
	cin>>a1>>a2;
	char c1 = s[0];
	char c2 = s[1];
	if (abs(a1-a2)>1)
		cout<<"nemoguce";
	else
	{
		if (a1>a2)
		{
			while(a1>0)
			{
				cout<<c1; a1--;
				if(a2>0)
				{
					cout<<c2; a2--;
				}
			}
		}
		else 
	    {
			while(a2>0)
			{
				cout<<c2; a2--;
				if(a1>0)
				{
					cout<<c1; a1--;
				}
			}
		}
	}

	
	
	
	
	
	return 0;
}