#include <iostream>
#include <cmath>

using namespace std;

int main() {
	char c1, c2;
	int a1, a2;
	
	cin >> c1 >> c2;
	cin >> a1 >> a2;
	
	if (abs(a1-a2) > 1) {
		cout << "nemoguce";
		return 1;
	}
	
	short int x;
	
	string s = "";
	
	(a1 > a2)? x=1 : x=0;
	
	for (int i=0; i<a1+a2; i++) {
		(x)? s+=c1 : s+=c2;
		x = !x;
	}
	
	cout << s;
	
	return 0;
}