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

int main()
{
    char c1, c2;
    unsigned short a1, a2, id;

    scanf("%c%c", &c1, &c2);
    scanf("%hu %hu", &a1, &a2);

    if (a1 == a2)
    {
        for (unsigned short i = 0; i < a1 * 2; i++)
            if (i % 2 == 0)
                printf("%c", c1);
            else
                printf("%c", c2);
    }
    else if ((a1 + 1) == a2)
    {
        id = 0;
        for (unsigned short i = 0; i < a1 * 2; i++)
            if (id == 0)
            {
                printf("%c", c2);
                id = 1;
            }
            else if (id == 1)
            {
                printf("%c", c1);
                id = 0;
            }

        printf("%c", c2);
    }
    else if ((a2 + 1) == a1)
    {
        id = 0;
        for (unsigned short i = 0; i < a1 * 2; i++)
        {
            if (id == 0)
            {
                printf("%c", c1);
                id = 1;
            }
            else if (id == 1)
            {
                printf("%c", c2);
                id = 0;
            }
        }

        printf("%c", c1);
    }
    else
        printf("nemoguce");

    return 0;
}