#include <iostream>

using namespace std;

int main()
{
    char a, b;
    a = getchar();
    b = getchar();

    int a1, b1;
    cin >> a1 >> b1;

    if (abs(a1 - b1) >= 2)
        cout << "nemoguce" << endl;

    else if (a1 > b1)
    {
        for (int i = 1; i <= a1; i++)
        {
            cout << a;
            if (i <= b1)
                cout << b;
        }
    }

    else if (a1 <= b1)
    {
        for (int i = 1; i <= b1; i++)
        {
            cout << b;
            if (i <= a1)
                cout << a;
        }
    }


    return 0;
}