#include <iostream>

using namespace std;

int main(void)
{
    char c1, c2;

    cin >> c1 >> c2;

    unsigned short int a1, a2;

    cin >> a1 >> a2;

    if(c1 == c2)
        cout << "nemoguce" << endl;
    else if(a1 > (a2 + 1) || a2 > (a1 + 1))
        cout << "nemoguce" << endl;
    else
    {
        unsigned short int i=0, j=0;

        while(true)
        {
            if(a1 >= a2)
            {
                if(i<a1)
                {
                    cout << c1; ++i;
                }
                if(j<a2)
                {
                    cout << c2; ++j;
                }
                if(i == a1 && j == a2)
                    break;
            }
            else
            {
                if(j<a2)
                {
                    cout << c2; ++j;
                }
                if(i<a1)
                {
                    cout << c1; ++i;
                }
                if(i == a1 && j == a2)
                    break;
            }

        }
    }


    return 0;
}