#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{
    string c;
    cin >> c;

    int a1, a2;
    cin >> a1 >> a2;

    if(a1 == a2)
    {
        while(a1 > 0)
        {
            cout << c;
            a1--;
        }
    }
    else if((a1 - 1) == a2)
    {
        while(a2 > 0)
        {
            cout << c;
            a2--;
        }
        cout << c[0];
    }
    else if((a2 - 1) == a1)
    {
        cout << c[1];
        while(a1 > 0)
        {
            cout << c;
            a1--;
        }
    }
    else
    {
        cout << "nemoguce";
    }
    return 0;
}