#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mk make_pair
#define v_sort(x) sort(x.begin(),x.end())
#define v_gsort(x) sort(x.begin(),x.end(),greater<ll>())
#define v_find(x,num) find(x.begin(),x.end(),num)
#define PI 3.14159265
#define MOD 1000000007
#define MOD1 998244353

using namespace std;

void Solve(){
  char c,c1;
  int a,b;
  cin>>c>>c1>>a>>b;
  string ans;
  if(abs(a-b)>=2) {cout<<"nemoguce";return;}
  if(a>b) ans+=c,swap(c,c1),a--;
  else if(a<b) ans+=c1,b--;
  for(int i=1;i<=a+b;i++) {
    if(i%2) ans+=c;
    else ans+=c1;
  }
  cout<<ans<<'\n';
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int t=1;
//  freopen("input.txt","r",stdin);
//  freopen("output.txt","w",stdout);
//  cin>>t;
  while(t--){
    Solve();
  }
  return 0;
}