#include <iostream>

int main()
{
    char c1,c2;
    int a1,a2;
    std::cin >> c1;
    std::cin >> c2;

    std::cin >> a1;
    std::cin >> a2;

    if ((a1-a2 <=1) && (a1-a2 >=-1)){
        if (a1>a2){
            for (int i = 1; i<a1; i++)
                std::cout << c1 << c2;
        std::cout << c1;
    }else if (a2>a1){

        for (int i = 1; i<a2; i++)
                std::cout << c2 << c1;
        std::cout << c2;
    }else
        for (int i = 0; i<a1; i++)
                std::cout << c1 << c2;
    }else
     std::cout << "nemoguce";

    return 0;
}