#include <iostream>
#include <vector>
#include <cmath>
#include <cstring>

using namespace std;

int main() {
	
	int a1, a2, minAB, maxAB, sumAB, brojac;
	string c1, c2, c12, c21;
	vector<string> rec;
	
	cin >> c12;
	cin >> a1 >> a2;
	
	minAB = min(a1, a2);
	maxAB = max(a1, a2);
	sumAB = a1 + a2;
	
	char arrayAB[2];
	strcpy(arrayAB, c12.c_str());
	
	c1 = arrayAB[0];
	c2 = arrayAB[1];
	c21 = c2 + c1;
	
	if((maxAB - minAB) > 1){
		cout << "nemoguce";
	}
	
	brojac = minAB;
	
	if((maxAB - minAB) <= 1){
		if(sumAB % 2 == 0){ //PARAN
			do{
				cout << c12;
				brojac--;
			}while(brojac > 0);
		}
		
		else{ //NEPARAN
			if(maxAB == a1){
				cout << c1;
				do{
				   cout << c21;
				   brojac--;
			    }while(brojac > 0);
			}
			else{
				cout << c2;
				do{
				   cout << c12;
				   brojac--;
			    }while(brojac > 0);
			}
		}
	}
	
	return 0;
}