#include <bits/stdc++.h>

using namespace std;

int main()
{
    int a1,a2,i=0;
    char c1,c2;
    scanf("%c %c %d %d",&c1,&c2,&a1,&a2);
    char s[a1+a2];
    if(abs(a1-a2)<=1)
    {
        while((a1>0)||(a2>0)){
            if(a1>a2)
            {
                s[i]=c1;
                a1--;
                if(a2 <= 0) continue;
                s[i+1]=c2;
                a2--;
            }
            else
            {
                s[i]=c2;
                a2--;
                if(a1 <= 0) continue;
                s[i+1]=c1;
                a1--;

            }
            i+=2;
        }
    }
    else{
        printf("nemoguce\n");
        return 0;
    }
    puts(s);
    cout << "\n";
    return 0;
}