#include <iostream>

using namespace std;

int main()
{
    char c1, c2;
    scanf("%c%c", &c1, &c2);
    long long a1, a2;
    cin >> a1 >> a2;
    if(a2 < a1) swap(a1, a2);
    if((a2-a1) > 1) cout << "nemoguce";
    else
    {
        if (a2 == a1)
        {
            for(long long i = 0; i < a1; i++)
            {
                cout << c2 << c1;
            }
        }
        else
        {
            for(long long i = 0; i < a1; i++)
            {
                cout << c2 << c1;
            }
            cout << c2;
        }
    }
    return 0;
}