#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);cerr.tie(0);
    string s, s1;
    std::cin >> s >> s1;
    char c1 = s[0];
    char c2 = s[1];

    int m = s1.find_first_of(' ');
    int a1 = stoi(s1.substr(0, m));
    int a2 = stoi(s1.substr(m + 1));

    if (abs(a1 - a2) > 1)
        cout << "nemoguce";
    else if (a1 >= a2){
        for (int i = 0; i < a2; i++) {
            cout << c1;
            cout << c2;
        }

        if (a1 > a2)
            cout << c1;
    }
    else if (a1 < a2){
        for (int i = 0; i < a2; i++) {
            cout << c2;
            cout << c1;
        }
    }

    return 0;
}