#include <iostream>

using namespace std;


int main() 
{
	string tekst;
	cin >> tekst;
	char s1;
	char s2;
	s1 = tekst[0];
	s2 = tekst[1];
	int a1;
	int a2;
	cin >> a1 >> a2;
	if (s1 == s2)
	{
		cout << "nemoguce";
		return 0;
	}
	else if (a1 - a2 > 1 || a2 - a1 > 1)
	{
		cout << "nemoguce";
		return 0;
	}
	int veci = a1;
	int manji;
	if (a1 > a2)
	{
		cout << s1;
		for (int i = 0; i < (a1 + a2 - 1) / 2; i++)
		{
			cout << s2 << s1;
		}
		return 0;
	}
	else if(a2>a1)
	{
		cout << s2;
		for (int i = 0; i < (a1 + a2 - 1) / 2; i++)
		{
			cout << s1 << s2;
		}
		return 0;
	}
	else
	{
		for (int i = 0; i < (a1 + a2) / 2; i++)
		{
			cout << s1 << s2;
		}
		return 0;
	}







	
}