#include <iostream>
#include <string>
using namespace std;
int main(){
	char c,d;
	int a,b,i;
	string kraj;
	cin>>c;
	cin>>d;
	cin>>a;
	cin>>b;
	if(a-b>=2 || b-a>=2){
		kraj="nemoguce";
	}else{
		while(a>0&&b>0){
			cout<<c;
			a--;
			cout<<d;
			b--;
		}
	}
	cout<<kraj;
}