#include<bits/stdc++.h>

using namespace std;

#define maxn 100005
#define pb push_back
#define fi firts
#define se second 
#define ppb pop_back

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
	char c1, c2;
	cin >> c1 >> c2;
	int a, b;
	cin >> a >> b;
	if(a > b + 1  ||  b > a + 1){
		cout << "nemoguce";
	}
	else if(a == b){
		for(int i=0; i<a; i++){
			cout << c1 << c2;
		}
	}
	else if(a == b + 1){
		for(int i=0; i<b; i++){
			cout << c1 << c2;
		}
		cout << c1;
	}
	else{
		for(int i=0; i<a; i++){
			cout << c2 << c1;
		}
		cout << c2;
	}
	
	return 0;
}