#include <bits/stdc++.h>

using namespace std;

int main(){

	char c1,c2;
	int a1,a2;
	string ans = "";
	scanf(" %c %c",&c1,&c2);
	scanf("%d%d",&a1,&a2);
	
	if(abs(a1-a2)>1){
		printf("nemoguce");
	}else{
		int veci = max(a1 ,a2);
		int mn = min(a1,a2);
		char vis = (veci == a1)? c1 : c2;
		char manj = (veci != a1)? c1 : c2;
		for(int i=1;i<=veci;i++){
			ans+=vis;
			if(mn!=0){
				ans+=manj;
				mn--;
			}
		}
		
		cout<<ans<<endl;
	}
	return 0;
}