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

int main()
{
    char x ,y;
    scanf("%c%c",&x ,&y);
    unsigned int a, b;
    scanf("%u %u", &a, &b);
    if (abs(a-b) > 1)
        printf("nemoguce");
    else
    {
            for (int i=0; i < a+b; i++)
            {
                if (a > b)
                {
                    if (i%2==0)
                        printf("%c",x);
                    else
                        printf("%c",y);
                }
                else
                {
                    if (i%2==0)
                        printf("%c",y);
                    else
                        printf("%c",x);
                }

            }
    }
}