#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long
#define rep(i,n) for(int i=0;i<n;i++)
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	char a, b;
	int c1, c2;
	cin >> a >> b >> c1 >> c2;
	if(abs(c1-c2) > 1) cout << "nemoguce";
	else{
		string ans = "";
		rep(i, c1+c2){
			if(c1 >= c2){
				if(i%2==0) ans+=a;
				else ans+=b;
			} 
			else{
				if(i%2==0) ans+=b;
				else ans+=a;
			} 
		}
		cout << ans;
	}
	return 0;
}