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

int main()
{
    char c1, c2;

    cin >> c1 >> c2;

    int a1, a2;

    cin >> a1 >> a2;

    string res;

    if(a1 == a2){

        for(int i = 0; i < a1 + a2; i = i +2){

            /*res[i] = c1;

            res[i+1] = c2;*/

            cout << c1 << c2;
        }

        //cout << res;
    }

    else if(a1 + 1 == a2){

        //res[0] = c2;

        cout << c2;

        for(int j = 1; j < a1 + a2 - 1; j = j + 2){

            /*res[j] = c1;

            res[j+1] = c2;*/

            cout << c1 << c2;
        }

        //cout << res;
    }

    else if(a2 + 1 == a1){

        //res[0] = c1;

        cout << c1;

        for(int h = 1; h < a1 + a2 - 1; h = h + 2){

            /*res[h] = c2;

            res[h+1] = c1;*/

            cout << c2 << c1;
        }

        //cout << res;
    }

    else cout << "nemoguce";

}