#include <iostream>
using namespace std;
int main(){
    char c1,c2;
    cin>>c1>>c2;
    int a1,a2;
    cin>>a1>>a2;
    if(a1-a2>1 || a2-a1>1){
        cout<<"nemoguce";
    }else{
        if(a1-a2==1 || a1==a2){
            while(a1>0){
                cout<<c1;
                if(a2>0){
                    cout<<c2;
                }
                a1--;
                a2--;
            }
        }else{
            if(a2-a1==1){
                while(a2>0){
                    cout<<c2;
                    if(a1>0){
                        cout<<c1;
                    }
                    a2--;
                    a1--;
                }
            }
        }
    }

 return 0;
}