#include<bits/stdc++.h>
using namespace std;
int main(){
	char c1,c2;
	int a1,a2;
	cin>>c1>>c2;
	cin>>a1>>a2;
	if(a1!=a2&&abs(a1-a2)!=1){
		cout<<"nemoguce";
		return 0;
	}
	string str="";
	for(int i=0;i<min(a1,a2);i++)str=str+c1+c2;
	if(a1!=a2){
		if(str[0]==c1)str=c2+str;
		else str=c1+str;
	}
	cout<<str;
}