#include <iostream>

using namespace std;

int main()
{
    /*ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);*/

    int a1,a2;
    char slova[2];
    gets(slova);
    cin >> a1 >> a2;
    if (a2 >= a1)
    {
        int pom = a1;
        a1 = a2;
        a2 = pom;
        char p = slova[0];
        slova[0] = slova[1];
        slova[1] = p;
    }
    if (abs(a1 - a2) >= 2)
    {
        cout << "nemoguce";
    }
    else
    {
        int i = 0, j = 0;
        for (int i = 0; i < a2; i++)
        {
            cout << slova[0] << slova[1];
        }
        if (a1 != a2)
            cout << slova[0];
    }
    return 0;
}