#include <iostream>

using namespace std;

int main()
{
    string c,rez;
    char c1, c2;
    int a1;
    int a2;
    cin >> c;
    cin >> a1 >> a2;

    c1 = c[0];
    c2 = c[1];

    if (abs(a1-a2)>1)
    {
        cout<< "nemoguce";
    }
    else
    {
        if (a1>a2)
        {
            rez = c1;
            for (int i = 0; i < a2; i++)
            {
                rez += c2;
                rez += c1;
            }
        }
        else
        {
            rez = c2;
            for (int i = 0; i < a1; i++)
            {
                rez += c1;
                rez += c2;
            }
        }
        if (a1 == a2)
        {
            rez = c1;
            for (int i = 0; i < a1-1; i++)
            {
                rez += c2;
                rez += c1;

            }
            rez += c2;
        }
        cout << rez;
    }
    
}