#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cerr.tie(NULL);
    cout.tie(NULL);

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