#include<iostream>
#include<string>
#include<math.h>
#include<algorithm>
using namespace std;
int main()
{
string s,st;
cin>>s;
char as=s[0],bs=s[1],c;
int a,b,i,n;
cin>>a>>b;
if(abs(a-b)>1)
cout<<"nemoguce";
else
{
if(b>a)	
{
c=as;
as=bs;
bs=c;
}
n=a+b;
for(i=0;i<n;i++)
if(i%2==0)
st=st+as;
else
st=st+bs;

}
cout<<st;
}