#include <iostream>
#include <cmath>

using namespace std;

int main() {
	char s1, s2;
	int b1, b2;
	string zbir;
	cin >> s1 >> s2 >> b1 >> b2;
	if(abs(b1 - b2) == 0 or abs(b1 - b2) == 1) {
		if (b1 > b2) {
			for(int i = 0; i < b2; i++) {
				zbir += s1;
				zbir += s2;
			}
			zbir += s1;
		}
		if(b2 > b1) {
			for(int i = 0; i < b1; i++) {
				zbir += s2;
				zbir += s1;
			}
			zbir += s2;
		}	
		else {
			for(int i = 0; i < b2; i++) {
				zbir += s1;
				zbir += s2;
			}
		}	
	}
	else cout << "nemoguce";
	cout << zbir;
	return 0;
}