#include<bits/stdc++.h>
using namespace std;

int main()
{
    string a, b = "";
    int x,y;
    cin>>a>>x>>y;
    if(abs(x-y) > 1)
        cout<<"nemoguce"<<endl;
    else
    {
        while(x>0 && y>0)
        {
            b+=a;
            x--;
            y--;
        }
        if(x==1)
            b+=a[0];
        if(y==1)
            b = a[1] + b;
        cout<<b<<endl;
    }
    return 0;
}