#include <bits/stdc++.h>

using namespace std;
char c1,c2;
int a1,a2;
int main(){
   cin>>c1>>c2>>a1>>a2;
   if (a1<a2){
      swap(a1,a2);
      swap(c1,c2);
   }
   if (a1==a2 or a1==a2+1){
      for (int i=1;i<=a1+a2;i++){
         if(i%2==0) cout<<c2;
         else cout<<c1;
      }
   }
   else cout<<"nemoguce"<<endl;
   return 0;
}