#include <iostream>

using namespace std;

int
main ()
{
  int a1, a2, x, s;
  string c1, c2, p, q;
  cin >> c1;
  cin >> c2;
  cin >> a1;
  cin >> a2;

  x = abs (a1 - a2);
  if (x == 0)
    {
      s = 0;
      while (s <= a1)
	{
	  p = c1 + c2;
	  s = s + 1;
	  q = q + p;
	  p = "";
	}
    }
  else if (x == 1)
    {
      if (a1 > a2)
	{
	  s = 0;
	  while (s <= a2)
	    {
	      p = c1 + c2;
	      s = s + 1;
	      q = q + p;
	      p = "";
	    }
	  q = q + c1;
	}
      else if (a2 > a1)
	{
	  s = 0;
	  while (s <= a1)
	    {
	      p = c2 + c1;
	      s = s + 1;
	      q = q + p;
	      p = "";
	    }
	  q = q + c2;
	}

    }
  if (x > 1)
    {
      cout << "nemoguce" << endl;
    }
  cout << q << endl;
  return 0;
}