#include <iostream>

using namespace std;


int main()
{
    char a ,b;
    int num_a, num_b;
    scanf("%c%c",&a, &b);
    scanf("%d %d",&num_a, &num_b);

    if(num_a> num_b+1 || num_b> num_a+1)
        {
            printf("nemoguce");
            return 0;
        }
    if(num_b>num_a)
    {
        int num_c = num_a;
        char c = a;
        a = b;
        b = c;
        num_a = num_b;
        num_b = num_c;
    }
    for(int i =0; i<num_b; i++)
    {
        printf("%c%c",a,b);
    }
    if(num_a>num_b)
    {
        printf("%c",a);
    }
    return 0;
}