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