#include <bits/stdc++.h>
using namespace std;
long long a1,b1;
char a,b;
int main(){
cin>>a>>b>>a1>>b1;
if(a1-2>=b1 or b1-2>=a1)cout<<"nemoguce"<<endl;
 else if(a1+1==b1){
		for(int i=1;i<=a1;i++){
			cout<<b<<a;
		}
		cout<<b<<endl;
 }
 else if(b1+1==a1){
	for(int i=1;i<=b1;i++){
			cout<<a<<b;
		}
		cout<<a<<endl;
 }
 else{
	for(int i=1;i<=b1;i++){
			cout<<b<<a;
		}
		cout<<endl;
 }





return 0;
}