// radC++.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>
#include <unordered_map>
#include <set>
using namespace std;
#define ll long long



int main()
{

	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	char a;
	char b;
	cin >> a;
	cin >> b;
	int a1,a2;
	cin >> a1 >> a2;
	if (abs(a1 - a2) > 1)
	{
		cout << "nemoguce";
		return 0;
	}
	char nes;
	if (a1 < a2)
	{
		nes = a;
		a = b;
		b = nes;
	}

	for (int i = 0; i < a1 + a2; i++)
	{
		if (i % 2 == 0)
		{
			cout << a;
		}
		else {

			cout << b;
		}
  }

}