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

string s;
int a1,a2;
char c1,c2,v,m;

int veci,manji;
int main(){

    cin>>c1>>c2;
    cin>>a1>>a2;

    veci=max(a1,a2);
    manji=min(a1,a2);

  if(veci==a1)v=c1;
  if(veci==a2)v=c2;

  if(c1==v)m=c2;
  if(c2==v)m=c1;

    if(abs(a1-a2)<=1)
    {
    for(int i=1;i<=a1+a2;i++){
     if(i%2==0)s+=m;

        if(i%2==1)s+=v;

  }cout<<s<<endl;
    }
else cout<<"nemoguce"<<endl;

return 0;
}