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

int main() {
	unsigned long long a1,a2,i;
	string c;
	cin >> c >> a1 >> a2;
	if (a1 == a2)
	{
		for (i=0 ; i<(a1) ; i++)
			cout << c;
	}
	
	else if (a1+1 == a2)
	{
		cout << c[1];
		for (i=0 ; i<(a1) ; i++) 
			cout << c;
	}
	
	else if (a2+1 == a1)
	{
		
		for (i=0 ; i<(a2) ; i++) 
			cout << c;
		cout << c[0];
		
	}
	
	else cout << "nemoguce";
	return 0;
}