#include <iostream>
#include <string>
using namespace std;

int main()
{
    char c1,c2;
    int a,b,i;
    string r;

    cin >> c1 >> c2 >> a >> b;

    if (a-b > 1 || b-a >1) {
         cout<<"nemoguce"<< endl;
    } else {
        if (a>b) {
            i = a;
        } else {
            i = b;
        }
        for (int j = 1; j<=i; ++j) {
            if (a > b) {
                if (a > 0) {
                    r += c1;
                }

                if (b>0) {
                    r+= c2;
                }
            } else {
                if (b > 0) {
                    r += c2;
                }

                if (a>0) {
                    r+= c1;
                }
            }
            --a;
            --b;
        }

        cout<<r<< endl;
    }

    return 0;
}