#include <iostream>

using namespace std;

int main()
{
    char  c1, c2;
    int x, y;
    cin >> c1 >> c2;
    cin >> x >> y;

    if(x + 1 == y){
        while(x > 0 && y > 0){
            cout << c1 << c2;
            x--;
            y--;
        }
    }
    else
        if(y + 1 == x){
            while(x > 0 && y > 0){
                cout << c1 << c2;
                x--;
                y--;
        }
    }
        else
            if(y == x){
            while(x > 0 && y > 0){
                cout << c1 << c2;
                x--;
                y--;
        }
    }
            else
                cout << "nemoguce";
    return 0;
}