#include <iostream>

int main()
{
	char c1, c2;
	int n1, n2;

	std::cin.get(c1);
	std::cin.get(c2);

	std::cin >> n1 >> n2;
	
	if(n1 - 1 > n2 || n1 < n2)
	{
		std::cout << "nemoguce\n";
		return 0;
	}

	bool other = false;
	while(n1 > 0 || n2 > 0)
	{
		if(other)
		{
			std::cout << c2;
			n2--;
		}
		else
		{
			std::cout << c1;
			n1--;
		}

		other = !other;
	}

	return 0;
}