#include<bits/stdc++.h>

using namespace std;

int main()
{
    char c1,c2;
    cin>>c1>>c2;
    int a,b;
    cin>>a>>b;

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

    }
}