#include <iostream>
#include <string>
#include <math.h>
#include <bits/stdc++.h>
using namespace std;








int main(int argc, char** argv) {
string st;
	cin>>st;
	char a = st[0];
	char b = st[1];
	int ab, bb;
	cin>>ab;
	cin>>bb;
	int raz = ab-bb;
	if(raz==1){
			for(int i = 0; i <ab-1;i++){
				cout<<a<<b;
			}
			cout<<a;
	}
	else if (raz==-1){
			for(int i = 0; i <bb-1;i++){
				cout<<b<<a;
			}
			cout<<b;
		}
		else if(raz == 0){
			for(int i =0; i<ab; i++){
				cout<<a<<b;
			}
		}
	else{
		cout<<"nemoguce";
	}
	return 0;
}