#include <iostream>

using namespace std;

void zameni(int &a, int &b)
{
    int p;
    p = a;
    a = b;
    b = p;
}
int main()
{
    int a1, a2;
    char c[2], c1, c2;

    cin >> c >> a1 >> a2;
    c1 = c[0];
    c2 = c[1];

    if(a1 > a2)
        zameni(a1, a2);
    if(a1 - a2 != 0 && a1 - a2 != 1)
        cout << "nemoguce" << endl;
    else
    {
        for(int i = 0; i < a2; i++)
        {
            a1--;
            cout << c1 << c2;
        }
        if(a1 > 0)
            cout << c1 << endl;
        else
            cout << endl;
    }

    return 0;
}