#include <iostream>
#include <algorithm>

int main() {
    std::string s;
    std::cin >> s;

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

    std::string r;
    if (a1 - a2 == 0) {
        for (int i = 0; i < a1; i++) {
            r += s;
        }
    } else if (a1 - a2 == 1) {
        for (int i = 0; i < a1; i++) {
            r += s;
        }
        r.resize(r.length() - 1);
    } else if (a1 - a2 == -1) {
        std::reverse(s.begin(), s.end());
        for (int i = 0; i < a2; i++) {
            r += s;
        }
        r.resize(r.length() - 1);
    } else {
        r = "nemoguce";
    }

    std::cout << r << std::endl;

    return 0;
}