#include <iostream>
#include <string>

using namespace std;

int main() {
	string c1, c2;
	int a1, a2;
	cin >> c1;
	cin >> a1 >> a2;
	c2 = c1;
	c1.erase(1, 1);
	c2.erase(0, 1);
	if (a1 - a2 > 1 || a2 - a1 > 1) {cout << "nemoguce" << endl;}
	else {
		string x;
		if (a1 - a2 == 1) {
			for (int i = 0; i < a2; i++) { x += c1 + c2; }
			x += c1;
		}
		else if (a1 - a2 == -1) {
			for (int i = 0; i < a1; i++) { x += c2 + c1; }
			x += c2;
		}
		else for (int i = 0; i < a2; i++) { x += c2 + c1; }
		cout << x;
	}
	return 0;
}