#include <bits/stdc++.h>
using namespace std;
char a,b;
int ab,bb,zbir;
int main(){
    cin>>a>>b;
    cin>>ab>>bb;
    zbir=ab+bb;
    if(ab-bb>=2 or bb-ab>=2){
        cout<<"nemoguce"<<endl;
    }
    else if (ab<bb){
           for(int i=1;i<=zbir;i++){
            if(i%2==0){
                cout<<a;
            }
            else {
                cout<<b;
            }

           }
         }
         else {
            for(int j=1;j<=zbir;j++){
                if(j%2==0){
                    cout<<b;
                }
                else {
                    cout<<a;
                }
            }
         }


    return 0;
}