#include <iostream>
#include <algorithm>
using namespace std;
int main(){
    string s;
    cin>>s;
    int a;
    int b;
    string c;
    cin>>a>>b;
    if(abs(a-b)<=1){
        if(b==a+1){
            c+=s[1];
        }
        for(int i=0;i<min(a,b);i++){
            c+=s;
        }
        if(a==b+1){
            c+=s[0];
        }
        cout<<c;
    }
    else{
        cout<<"nemoguce";
    }
}