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

int main()
{
    char c1,c2,longerc,shorterc;
    int a1,a2,longern,shortern;
    scanf("%c%c", &c1,&c2);
    scanf("%i%i", &a1,&a2);
    if(a1>a2)
    {
        longerc= c1;
        longern= a1;
        shortern= a2;
        shorterc= c2;

    }
    else
    {
        longerc=c2;
        longern=a2;
        shorterc=c1;
        shortern=a1;
    }
    if(abs(a1-a2)>1){
        printf("nemoguce");
    }
    else
    {
        for (int i=0; i<longern; i++)
        {
            printf("%c", longerc);
            if (i<shortern)
                printf("%c", shorterc);
        }
    }
    return 0;
}