#include <iostream>
#include <string>
using namespace std;
int main()
{
    string ab;
    long long a, b;
    cin >> ab >> a >> b;
    long long n;
    if (abs(a - b) > 1)
        cout << "nemoguce";
    else if (a > b)
    {
        n = b;
        for (long long i = 0; i < n; i++)
        {
            cout << ab.at(0) << ab.at(1);
        }
        cout << ab.at(0) << endl;
    }
    else if (b > a)
    {
        n = a;
        for (long long i = 0; i < n; i++)
        {
            cout << ab.at(1) << ab.at(0);
        }
        cout << ab.at(1) << endl;
    }
    else if (a == b)
    {
        n = b;
        for (long long i = 0; i < n; i++)
        {
            cout << ab.at(0) << ab.at(1);
        }
        cout << endl;
    }
}