#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define sc second
#define th third
#define fo fourth
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ldb double
#define endl "\n"
int main()
{
    ios::sync_with_stdio(false); cin.tie(0);
    string s;
    cin>>s;
    int a,b;
    cin>>a>>b;
    if(abs(a-b)>1) cout<<"nemoguce";
    else if(a-b==1)
    {
        for(int i=0;i<b;i++) cout<<s;
        cout<<s[0];
    }
    else if(a-b==-1)
    {
        for(int i=0;i<b;i++) cout<<s[1]<<s[0];
        cout<<s[0];
    }
    else for(int i=0;i<b;i++) cout<<s;
    return 0;
}