#include <stdio.h>
#include <stdlib.h>

int main() 	
{
	char a[2];
	int n,m;
	scanf("%s",&a);
	scanf("%d %d",&n,&m);
	int countn,countm = 0;
	if(m > n + 1 || n > m + 1)
	{
		printf("nemoguce");
		return 0;
	}
	if(m > n)
	{
		char temp = a[0];
		a[0] = a[1];
		a[1] = temp;
	}
	for(int i = 0 ; i < n+m ; i++)
	{
		if(i % 2 == 0)
		{
			if(countn != n)
			{
				countn++;
				printf("%c",a[0]);
			}
		}
		else
			if(countm != m)
			{
				countm++;
				printf("%c",a[1]);
			}
	}
	return 0;
}