#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+=2){

            /*res[i] = c1;

            res[i+1] = c2;*/

            cout << c1 << c2;
        }
    }

    else if(a1 + 1 == a2){

        cout << c2;

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

            cout << c1 << c2;
        }
    }

    else if(a2 + 1 == a1){

        cout << c1;

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

            cout << c2 << c1;
        }
    }

    else cout << "nemoguce";

}