#include<iostream>
#include<cmath>
using namespace std;
main()
{
    int a1, a2;
    char c1, c2;
    cin>>c1; cin>>c2; 
	cin>>a1; cin>>a2;
	if(a1-a2==0 || abs(a1-a2)==1) {
		for(int i=0; i<a1+a2; i++) {
			if(a1<a2) {
				if(i%2==0) {
					cout<<c2;
				}
				else cout<<c1;
			}
			else {
				if(i%2==0) {
					cout<<c1;
				}
				else cout<<c2;
			}
		}
	}
	else cout<<"nemoguce";
	getchar();
}