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

}
else if(a1>a2){
  for(int i=1;i<=(a1+a2)/2;i++){
    cout<<c1<<c2;
  }
  cout<<c1;
  return 0;
}
else if(a1<a2){
  for(int i=1;i<=(a1+a2)/2;i++){
    cout<<c2<<c1;
  }
  cout<<c2;
  return 0;
}
else if(a1==a2){
  for(int i=1;i<=(a1+a2)/2;i++){
    cout<<c2<<c1;
  }
}
return 0;
}