#include<iostream>

using namespace std;

void FICA()
{
    char c1,c2;
    cin>>c1>>c2;
    int a1,a2;
    cin>>a1>>a2;

    if(abs(a1-a2) > 1){
        cout<<"nemoguce";
    }else{
        if(a1 > a2){
            for(int i=0;i<a1+a2;++i){
                if(i%2 == 0){
                    cout<<c1;
                }else{
                    cout<<c2;
                }
            }
        }else{
            for(int i=0;i<a1+a2;++i){
                if(i%2 == 0){
                    cout<<c2;
                }else{
                    cout<<c1;
                }
            }
        }
    }
}

int main(void)
{
    FICA();
    return 0;
}