#include <iostream>
using namespace std;

int main ()
{
  int a, b;
  char c, d;
  cin >> c >> d;
  cin >> a >> b;
  if(a-b < -1 || a-b > 1)
    cout << "nemoguce" << endl;
  else
    if(a>b)
    {
      for(int i = 0; i < (a+b)/2; i++)
        cout << c << d;
      cout << c << endl;
    }
    else
    {
      for(int i = 0; i < (a+b)/2; i++)
        cout << d << c;
      if(b>a)
        cout << d << endl;
    }
    return 0;
}