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

    }
}