#include <iostream>
#include <string>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	char a;
	cin>>a;
	char b;
	cin>>b;
	int quanta;
	cin>>quanta;
	int quantb;
	cin>>quantb;
	int temp;
	if(quantb>quanta){
		temp=quantb;
		quantb=quanta;
		quanta=temp;
		char tempc=b;
		b=a;
		a=tempc;
	}
		
    bool isti = quanta == quantb;
	if(quanta-quantb<=1){
		while(quanta>0){
			cout<<a;
			if(quanta >1 || isti){
				cout<<b;
			}
			quanta--;
		}
	} else {
		cout<<"nemoguce";
	}
	
		
	}