#include<bits/stdc++.h>
using namespace std;
int a1,a2;
char c1,c2;
int main(){
	cin>>c1>>c2>>a1>>a2;
	if(a1<a2){
		swap(c1,c2);
		swap(a1,a2);
	}
	if(a1-a2>1)cout<<"nemoguce"<<endl;
	else{
		for(int i=1; i<=a2; i++)cout<<c1<<c2;
		if(a1>a2)cout<<c1;
		cout<<endl;
	}
	return 0;
}