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

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

    scanf("%c%c\n",&c1,&c2);
    scanf("%d %d",&a1,&a2);


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

    }

    else{
    unsigned int n = a1 + a2;
    unsigned int x = a1;
    unsigned int y = a2;

    if(a1==a2){
    for(unsigned int i=0;i<n/2;i++){
    printf("%c",c1);
    printf("%c",c2);
    }
    }

    else if(a1>a2){
    for(unsigned int i=0;i<n;i++,x--,y--){
    if(x>0){
    printf("%c",c1);
    }
    if(y>0){
    printf("%c",c2);
    }
    }

    }


    else if(a2>a1){
    x=a1;
    y=a2;

    for(int i=0;i<n;i++,y--,x--){
    if(y>0){
    printf("%c",c2);
    }
    if(x>0){
    printf("%c",c1);
    }
    }

    }

    }


}