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

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(abs(x-y)==1){
        if(x>y){
            while(x>1){
                cout << a << b;
                x--;
            }
            cout << a;
        }
        else{
            while(y>1){
                cout << b << a;
                y--;;
            }
            cout <<b;
        }
    }
    else{
        cout << "nemoguce";
    }

    return 0;
}