#include <stdio.h>
#include<math.h>

int main()
{
	char c1, c2;
	int n1, n2;

	scanf("%c%c", &c1, &c2);
	scanf("%d%d", &n1, &n2);

	if (abs(n1 - n2) > 1)
	{
		printf("nemoguce");
	}
	else
	{
		if (n1 == n2)
		{
			for (int i = 0; i < n1; i++)
			{
				printf("%c%c", c1, c2);
			}
		}
		else if (n1 > n2)
		{
			for (int i = 0; i < n2; i++)
			{
				printf("%c%c", c1, c2);
			}
			printf("%c", c1);
		}
		else if (n2 > n1)
		{
			printf("%c", c2);
			for (int i = 0; i < n1; i++)
			{
				printf("%c%c", c1, c2);
			}
		}
	}
	return 0;
}