#include<bits/stdc++.h>
using namespace std;
char c1,c2;
int a1,a2;
int brojac=1;
int main ()
{
  cin >> c1 >> c2;
  cin >> a1 >> a2;
  if(a2>=a1+2 or a1>=a2+2)
  {
    cout << "nemoguce";
    return 0;
  }

  if(a1==a2)
  {
    while(brojac <=a1+a2-1)
    {
      cout << c2;
      brojac++;
      cout << c1;
      brojac++;
    }
    return 0;
  }

  if(a2>a1)
  {
    while(brojac <=a1+a2-1)
    {
      cout << c2;
      brojac++;
      cout << c1;
      brojac++;
    }
    cout << c2 << endl;
    return 0;
  }

  if(a1>a2)
  {
    while(brojac <=a1+a2-1)
    {
      cout << c1;
      brojac++;
      cout << c2;
      brojac++;
    }
    cout << c1 << endl;
    return 0;
  }

}