#include <iostream>
#include <algorithm>
using namespace std;
int main(int argc, char** argv) {
	ios_base::sync_with_stdio(false);
	
	string s;
	cin >>s;
	int a,b;
	cin >>a>>b;
	if(b>a)
	{
		int pom=a;
		a=b;
		b=pom;
		reverse(s.begin(),s.end());
	}
	if(a>b+1)
	{
		cout <<"nemoguce\n";
	}
	else if(a==b)
	{
		for(int i=0;i<b;i++)
		{
			cout <<s;
		}
		cout <<"\n";
	}
	else
	{
		for(int i=0;i<b;i++)
		{
			cout <<s;
		}
		
		cout <<s[0]<<"\n";
	}
	return 0;
}