#include <iostream>

int main()
{
	char c1, c2;
	int a1, a2;		
	std::cin >> c1 >> c2 >> a1 >> a2;	

	if (std::abs(a2 - a1) > 1)
		printf("nemoguce");
	else
	{
		if (a1 < a2)
		{
			std::swap(a1, a2);
			std::swap(c1, c2);
		}

		char* str = new char[a1 + a2 + 1];

		for (int i = 0; i < a1 + a2 - 1; i += 2)
		{
			str[i + 0] = c1;
			str[i + 1] = c2;
		}

		if (a1 > a2)
			str[a1 + a2 - 1] = c1;

		str[a1 + a2] = '\0';

		printf(str);

		delete[] str;
	}
	return 0;
}