#include <bits/stdc++.h>
using namespace std;
int main(){
int a1,a2;
char c1,c2;
cin>>c1>>c2;
cin>>a1>>a2;
if((a1-a2)>1 or (a2-a1)>1)
    cout<<"nemoguce"<<endl;
else{
    for(int i=1;i<=(max(a1,a2));i++){
    if(a1>a2)
        cout<<c1<<c2;
    else cout<<c2<<c1;
    }

}
return 0;
}