#include <iostream>

using namespace std;

int main()
{
    string c;
    
    int x, y;
    
    cin >> c;
    
    cin >> x >> y;
    
    int k;
    
    k = x - y;
    
    if (abs(k) > 1)
        cout << "nemoguce";
    else
        if (k == 0)
        {
            for (; x > 0; x--)
                cout << c;
        }
        else
        {
            if (k == -1)
            {
                cout << c[1];
                for (;x > 0; x--)
                    cout << c;
            }
            else
            {
                for (; y > 0; y--)
                    cout << c;
                cout << c[0];
            }
        }

    return 0;
}