#include <stdio.h>
#include <iostream>
#include <string>
#include <cmath>

using namespace std;
int main()
{
    int a1, a2;
    string c1, c2, n;
    cin >> n;
    cin >> a1 >> a2;
    c1 = n[0];
    c2 = n[1];

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