#include <iostream>
#include <string>

int main()
{
	std::string c1, c2, x;
	long long a1, a2;

	std::cin >> c1;
	c2 = c1[1];
	c1 = c1[0];
	std::cin >> a1 >> a2;

	if (a1 - a2 >= 2 || a1 - a2 <= -2) {
		std::cout << "nemoguce";
	}
	else {
		if (a1 > a2) {
			x = c1;
			for (int i = 1; i < a1; i++) {
				x += c2;
				x += c1;
			}
		}
		else if (a2 > a1) {
			x = c2;
			for (int i = 1; i < a2; i++) {
				x += c1;
				x += c2;
			}
		}
		else {
			for (int i = 0; i < a1; i++) {
				x += c1;
				x += c2;
			}
		}
		std::cout << x;
	}

	return 0;
}