#include<bits/stdc++.h>
using namespace std;

int main(){
	char c1,c2;
	int a1,a2;
	string s;
	cin >> c1 >> c2 >> a1 >> a2;
	if (max(a1,a2) - min(a1,a2) > 1){
		cout << "nemoguce";
		return 0;
	}
	if (a1 == a2){
		for (int i = 0; i < a1; i++){
			if (i == 0){
				s = c1;
				s += c2;
			}
			else {
				s += c1;
				s += c2;
			}
		}
		cout << s;
		return 0;
	}
	if (a1 > a2){
		s = c1;
		for (int i = 0; i < a2; i++){
			s += c2;
			s += c1;
		}
		cout << s;
		return 0;
	}
	if (a2 > a1){
		s = c2;
		for (int i = 0; i < a1; i++){
			s += c1;
			s += c2;
		}
		cout << s;
		return 0;
	}
}