#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	string s;
	cin>>s;
	char a=s[0],b=s[1];
	long long x,y;
	cin>>x>>y;
	if(x-1>y or y-1>x){
		cout<<"nemoguce";
	}
	else{
		string r="";
		if(x==y){
			for(int i=0;i<2*x;i++){
				if(i%2==0){
					cout<<a;
				}
				else{
					cout<<b;
				}
			}
		}
		else{
			if(y-1==x){
				char t=a;
				a=b;
				b=t;
				
			}
			for(int i=0;i<x+y;i++){
					if(i%2==0){
						cout<<a;
					}
					else{
						cout<<b;
					}
				}
			}
	}
	
	return 0;
}