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

int main()
{
	char c, d;
	int x, y;

	scanf("%c%c ", &c, &d);
	if(c == d) return 1;
	scanf("%d %d", &x, &y);
	if(x < 1 || x > 50000 || y < 1 || y > 50000) return 1;
	if(fabs(x - y) > 1) 
	{
		printf("nemoguce\n");
		return 1;
	}
	else
	{
		char* str = (char*)malloc((x+y+1) * sizeof(char));
		bool prvi = x > y;
		for(int i = 0; i < x+y; i++)
		{
			if(prvi) str[i] = c;
			else str[i] = d;
			prvi = !prvi;
		}
		printf("%s\n", str);
	}
	return 0;
}