#include<bits/stdc++.h>
using namespace std;
int v,l,a1,b1,k;
string v1;
char a,b;
int main(){

cin>>a>>b;
cin>>a1>>b1;
v=min(a1,b1);
k=min(a1,b1);
l=max(a1,b1);

v1[a1]=a;
v1[b1]=b;

if(a1==b1){
    while(v--){
        cout<<a<<b;
    }
}
else if(l-v>1){
    cout<<"nemoguce"<<endl;
}

else if(l-v==1){
    while(v--){
        cout<<v1[l]<<v1[k];
    }
    cout<<v1[l];
}


return 0;
}