#include <iostream>
#include <string>
#include <math.h>
using namespace std;

int main(int argc, char** argv) {
	
	string a;
	string b;
	int ab, bb;
	cin>>a;
	cin>>b;
	cin>>ab;
	cin>>bb;
	
	if(abs(ab-bb) <=1){
		if(ab >bb){
			
			for(int i = 0; i <ab-1;i++){
				cout<<a+b;
			}
			cout<<a;
		}
		else if (bb>ab){
			for(int i = 0; i <bb-1;i++){
				cout<<b+a;
			}
			cout<<b;
		}
		else{
			for(int i =0; i<ab; i++){
				cout<<a+b;
			}
		}
	}
	else{
		cout<<"nemoguce";
	}
	
	return 0;
}