#include <bits/stdc++.h>
#include <limits.h>

using namespace std;


int main(){

	string s,sout;
	cin>>s;
	int a,b;
	cin>>a>>b;
	if(a==b){
		while(a!=0){
			sout+=s;
			a--;
		}
		cout<<sout;
	}else if((a-b)==1){
		while(b!=0){
			sout+=s;
			b--;
		}
		sout+=s[0];
		cout<<sout;
	}else if((b-a)==1){
		sout+=s[1];
		while(a!=0){
			sout+=s;
			a--;
		}
		cout<<sout;

	}else{

		cout<<"nemoguce";
	}
   

	
}