#include <iostream>
#include <string>
using namespace std;

int main() {
	char c1,c2,c3;
	unsigned short int a1,a2;
	cin>>c1>>c2;
	cin>>a1>>a2;
	string a;
	if(a1<a2){
		a1=a1+a2;
		a2=a1-a2;
		a1=a1-a2;
		c3=c1;
		c1=c2;
		c2=c3;
	}
	if(a1-a2==0||a1-a2==1){
		for(unsigned short int r=a2;r>0;r--){
				a+=c1;
				a+=c2;
		}
		if(a1-a2==1){
			a+=c1;
		}
		cout<<a;
		
			
	}
	else{

		cout<<"nemoguce";
	}
	return 0;
}