#include <iostream>

using namespace std;

int main()
{

    char c1,c2;
    string x;
    int a1,a2,y;
    cin >> x;
    c1 = x[0];
    c2 = x[1];
    if(c1==c2){
        cout << "nemoguce";
        return 0;
    }
    cin >> a1 >> a2;
    y = abs(a1-a2);
    if(y < 2){
        if(a2-a1==1){
            cout << c2;
        }
        for(int i=0;i<min(a1,a2);i++){
            cout << x;
        }
        if(a1-a2==1){
            cout << c1;
        }
    }else{
        cout << "nemoguce";
    }

    return 0;
}