#include <iostream>
#include <string>

using namespace std;

int main() {
	string slova;
	int num_s1, num_s2;
	string resenje = "";
	int index;
	cin>>slova;
	cin>>num_s1>>num_s2;
	if (num_s1 - num_s2 <=1 && num_s2 - num_s1 <= 1){
		switch(num_s1 > num_s2){
			case true: index = 2;
			break;
			case false: index = 3;
			break;
			default: index = 2;
			break;
		}
		for (int i = 0; i < num_s1 + num_s2; i++){
				resenje += slova[index % 2];
				index++;
		}
	}
	else{
		cout<<"nemoguce";
	}
	cout<<resenje;
	return 0;
}