#include<bits/stdc++.h>
using namespace std;

int main()
{
    int a1, a2;
    string x, c1, c2;

    cin >> x >> a1 >> a2;

    c1 = x[0];
    c2 = x[1];
    
	if(abs(a1 - a2) > 1)
	{
		cout << "nemoguce";
	}
	else
	{
		while(a1 > 0 || a2 > 0)
		{
			if(a1 > 0)
			{
				cout << c1;
				a1--;
			}
			
			if(a2 > 0)
			{
				cout << c2;
				a2--;
			}
		}
	}
	
	return 0;
}