#include <iostream>

using namespace std;

int main()
{
    int a, b;
    char c, d;
    cin >> c >> d >> a >> b;
    if(a - b == 1)
    {
    cout << c;
    for(int i =0;i<b;i++)cout<<d<<c;
    }
    else
        if(a == b)for(int i = 0; i < a; i++) cout << c << d;
    else
        if(b - a == 1)
    {
        cout << d;
        for(int i = 0; i < a; i++) cout << c << d;
    }
    else cout << "nemoguce";
    return 0;
}