#include <iostream>

using namespace std;

int main()
{
    string n,konacan;
    unsigned int a1,a2;
    int i;
    cin >> n;
    cin >> a1 >> a2;
    string c1 = n.substr(0,1);
    string c2 = n.substr(1);

    if (max(a1,a2)- min(a1,a2) == 1){
            if (a1 > a2){
                for (i=0; i < a2; i++){
                        konacan += c1;
                        konacan += c2;
                        }
                konacan += c1;
            }
            if (a2 > a1){
                for(i=0; i < a1; i++){
                        konacan += c2;
                        konacan += c1;
                        }
                konacan += c2;
            }
            cout << konacan;
            }
    else if (a1 == a2){
                for (i=0; i < a2; i++){
                        konacan += c1;
                        konacan += c2;
                }
                cout << konacan;
                }

    else{
        cout<<"nemoguce";
    }
    return 0;
}