#include<bits\stdc++.h>

using namespace std;

int main()
{
ios_base :: sync_with_stdio(false);
cin.tie(0);cout.tie(0);
string s,s1;
char c1,c2;
int a1,a2,i,m,ma;
cin>>s;
cin>>a1>>a2;
c1=s[0];
c2=s[1];
if(a1>=a2){
m=c1;
ma=c2;
}
else{
m=c2;
ma=c1;
}
if(abs(a1-a2)>1) cout<<"nemoguce"<<'\n';
else {for(i=0;i<a1+a2;i++){
if(i==0||i%2==0)s1.push_back(m);
else s1.push_back(ma);
}
cout<<s1<<'/n';

}
    return 0;
}