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

    else{
     for(int i=0;i<a1 and i<a2;i++){
       ss+=c1;ss+=c2;
     }
    }
    cout<<ss<<endl;
    
        return 0;
   }