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

int main()
{
    char a,b;
    int n1,n2;

    scanf("%c", &a);
    scanf("%c", &b);
    printf("\n");
    scanf("%d", &n1);
    scanf("%d", &n2);
    char c[n1+n2];

    if((n1+n2)==0)
    {
        printf("nemoguce");
        return 0;
    }

    if(abs(n1-n2)==0 || abs(n1-n2)==1)
    {
        int br=0;
        int i;
        if(n1>=n2)
        {
            for(i=0;i<n1+n2;i=i+2)
            {
                c[i]=a;
                c[i+1]=b;
            }
        }
        else
        {
            for(i=0;i<n1+n2;i=i+2)
            {
                c[i]=b;
                c[i+1]=a;
            }
        }
    if((n1+n2)%2!=0)
    c[n1+n2]=NULL;

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

    return 0;
}