#include <iostream>
#include <cmath>
#include <string>
using namespace std;

int main()
{
string c1, c2, c, s;
int a1, a2;
cin>>c;
cin>>a1>>a2;
c1=c[0];
c2=c[1];
if(abs(a1-a2)>=2)
    cout<<"nemoguce";
else if(a1==a2)
{
    while(a2>0)
    {
        cout<<c2<<c1;
        a2--;
    }
}
else if(a1>a2)
{
    cout<<c1;
    while(a2>0)
    {
        cout<<c2<<c1;
        a2--;
    }
}
else if(a2>a1)
{
    cout<<c2;
    while(a1>0)
    {
        cout<<c1<<c2;
        a1--;
    }
}
}