#include<string.h>
#include<stdio.h>
#include<math.h>
char* Sort(char stringu[])
{
    static char u[] = {""};
    strcpy(u,stringu);
    for(int i = 0; i < strlen(u); i++){
        int j = i;
        while(j > 0 && j < strlen(u) - 1 && (u[j+1] == u[j] || u[j-1] == u[j])){
            char t= u[j];
            u[j] = u[j-1];
            u[j-1] = t;           
            j--;
        }
        if(u[1] == u[0]){
            char t = u[0];
            u[0] = u[strlen(u)-1];
            u[strlen(u)-1] = t;
        }
    }
    return u;
}
main(){
	char c1[2], c2[2];
	int a1, a2;
	scanf("%s%s%d%d", &c1,&c2,&a1,&a2);
	char n[1000] = "";
	for (int i = 0; i <a1; i++)
        strcat(n, c1);
    for(int i = 0; i<a2; i++)
    	strcat(n,c2);
	if(a1 == a2 || abs(a1-a2) == 1)
		printf("%s",Sort(n));
	else
		printf("Nemoguce");
}