#include <iostream>
#include <string>

struct Favourite {
    char letter;
    int count;
};

void Untie();
std::string Cascade(Favourite, Favourite);

int main() {
    Untie();
    Favourite pera;
    Favourite petra;
    std::cin >> pera.letter >> petra.letter;
    std::cin >> pera.count >> petra.count;
    std::cout << Cascade(pera, petra) << std::endl;
    return 0;
}

void Untie() {
    std::ios_base::sync_with_stdio(false);
    std::cout.tie(nullptr);
    std::cerr.tie(nullptr);
    std::cin.tie(nullptr);
}
std::string Cascade(Favourite first, Favourite second) {
    if (first.count < second.count) {
        std::swap(first, second);
    }
    if (first.count - second.count > 1) {
        return "nemoguce";
    }
    std::string cascade;
    if (first.count - second.count == 1) {
        cascade = first.letter;
    }
    std::string sequance = { second.letter, first.letter };
    while (second.count--) {
        cascade += sequance;
    }
    return cascade;
}