#include <bits/stdc++.h>

int main() {

    char c1,c2;
    scanf(" %c%c",&c1,&c2);
    int a,b;
    scanf("%d%d",&a,&b);

    if(abs(a-b)>1) {printf("nemoguce\n");return 0;}
    char* rez = (char*)malloc(a+b+1);
    /*if (a>b) {
            printf("usao\n");
        for (int i=0; i<a+b; i+=2) rez[i] = c1;
        for (int i=1; i<a+b; i+=2) rez[i] = c2;
    }
    if (a==b) {



    }*/
    for (int i=0; i<a+b; i+=2) rez[i] = c1;
    for (int i=1; i<a+b; i+=2) rez[i] = c2;
    //*rez = '\0';
    //puts(rez);
    printf("%s\n", rez);


}