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

int main()
{
    char c1, c2;
    int a1, a2;
    scanf("%c %c", &c1, &c2);

    scanf("%d", &a1);
    scanf("%d", &a2);

    if (a1>a2+1 || a2>a1+1) {
        printf("nemoguce");
        return 0;
    }

    int i;
    int turn = 0;
    for (i=0; i<a1+a2; i++) {
        if (a1>a2) {
            if (turn == 1) {
                printf("%c", c2);
                turn = 0;
            }
            else {
                printf("%c", c1);
                turn = 1;
            }
        }
        else
        {
            if (turn == 1) {
                printf("%c", c1);
                turn = 0;
            }
            else {
                printf("%c", c2);
                turn = 1;
            }
        }
    }

    return 0;
}