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


int main()
{
    int a1, a2;
    char c1, c2;
    cin >> c1 >> c2 >> a1 >> a2;
    string s[1000];

    if (abs(a1 - a2) <=1)
    {
        for (int i = 0; i <= a1 + a2; i++)
        {
            if (a1 > a2) {
                s[i] = c1;
                if (i % 2 != 0)
                {
                    s[i] = s[i] + c2;
                }
                else s[i] = s[i] + c1;
            }
            else if (a2 > a1)
            {

                s[i] = c2;
                if (i % 2 != 0)
                {
                    s[i] = s[i] + c1;
                }
                else s[i] = s[i] + c2;

            }
            else
            {

                s[i] = c1;
                if (i % 2 != 0)
                {
                    s[i] = s[i] + c2;
                }
                else s[i] = s[i] + c1;
            }
        }
        cout << s;
    }
    else cout << "nemoguce";
}