#include <iostream>
#include <string>
#include <cmath>

using namespace std;

int main()
{
	string s;
	int a1, a2;
	
	cin >> s >> a1 >> a2;
	
	if(s[0] == s[1] || abs(a1-a2) >= 2)
		cout <<"nemoguce" <<endl;
		
	else
	{
		string res = "";
		for(int i = 0; i < (a1 <= a2 ? a1 : a2); ++i)
			res+=s;
		if(a1 > a2)
			res+=s[0];
		else if(a2 > a1)
			res=s[1]+res;
			
		cout << res << endl;
	}
}