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