#include<iostream>
using namespace std;

int main(){
	char c1,c2;
	int a1,a2;
	cin.get(c1);
	cin.get(c2);
	cin>>a1>>a2;
	if(max(a1,a2)-min(a1,a2)>1) cout<<"Nemoguce";
	if(a1>a2) cout<<c1;
	for(int i=0;i<min(a1,a2);i++) cout<<c2<<c1;
	if(a2>a1) cout<<c2;
	return 0;
}