#include <iostream>
#include <iomanip>
#include <climits>

using namespace std;

int main(){
    string a,b;
    int x,y;

    cin >> a >> x >> y;

    b = a[1];
    a[1] = 0;

    if(x-y==0){
        while (x>0){
            cout << a << b;
            x--;
        }
    }
    else if(x-y==1){
        if(x>y)
            while(x>0){
                cout << a << b << a;
                x-=2;
            }
        else
            while(y>0){
                cout << b << a << b;
                y-=2;
            }
    }
    else{
        cout << "nemoguce";
    }

    return 0;
}