#include <bits\stdc++.h>

using namespace std;

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  char c1, c2;
  int a1, a2;
  string b="";
  cin>>c1>>c2;
  cin>>a1>>a2;
  if(a1==a2){
   for(int i=1;i<=a1;i++){
    b+=c1; b+=c2;
   }
  cout<<b<<endl;

   }
  if(a1+1==a2){
   b+=c2;
  for(int i=1; i<=a1; i++){
    b+=c1; b+=c2;
  }

  cout<<b<<endl;

 }
  if(a1==a2+1){
   b+=c1
   for(int i=1; i<=a2; i++){
    b+=c2; b+=c1;
  }

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

  return 0;
}