#include <bits/stdc++.h>

using namespace std;

int main()
{
    string s;
    int a,b;
    cin>>s;
    cin>>a>>b;
    string res = "";
    for(int i = 0; i<a && i<b; i++){
        res+=s;
    }
    if(a==b){
        cout<<res;
    }
    else if(a==(b+1)){
        res+=s[0];
        cout<<res;
    }
    else if(a==(b-1)){
        res = s[1] + res;
        cout<<res;
    }
    else{
        cout<<"nemoguce";
    }
}