// I may fail a thousand times
// But there is no giving up
// IOI - here I come
#include <bits/stdc++.h>
using namespace std;
signed main(){
  ios_base::sync_with_stdio(0);cin.tie(0);
	string s;cin>>s;
	int a,b;cin>>a>>b;
	if(a<b)swap(s[0],s[1]),swap(a,b);
  int aa=a,bb=b;
	string ans="";
	for(int i=0;i<aa+bb;i++){
		if(i&1^1){
			if(!a){
				cout<<"nemoguce\n";
				return 0;
			}
			ans=ans+s[0];
			a--;
		}else{
			if(!b){
				cout<<"nemoguce\n";
				return 0;
			}
			ans=ans+s[1];
			b--;
		}
	}
	cout<<ans<<'\n';
	return 0;
}