#include<iostream>
using namespace std;
const int nmax=1e5;
int a,b;
char niz[2],res[nmax];
int main()
{
	cin >> niz;
	cin >> a >> b;
	if(abs(a-b)>1)
	{
		cout<<"nemoguce";
	}
	else if(a-b<0)
	{
		for(int i=0;i<a+b;i++)res[i]=niz[(i+1)%2];
		cout << res;
	}
	else
	{
		for(int i=0;i<a+b;i++)res[i]=niz[(i)%2];
		cout << res;
	}

}