#include <bits/stdc++.h>

using namespace std;

int main()
{
    char c1, c2;

    int i = 0;

    cin >> c1 >> c2;

    unsigned short a1, a2;

    cin >> a1 >> a2;

    char str[a1+a2];

    if(abs(a1-a2) == 0 || abs(a1-a2) == 1){

        for(a1; a1 > i; a1--){

            str[a1] = c1;

            for(a2; a2 > i; a2--){

                str[a2] = c2;
            }
        }

        cout << str;

    }
    else{

        cout << "nemoguce";
    }

    return 0;
}