#include <iostream>
using namespace std;
int main() {
    string c1c2;
    int a1; int a2;
    cin >> c1c2;
    char c1 = c1c2[0];
    char c2 = c1c2[1];
    string rec = "";
    cin >> a1 >> a2;
    int max = (a1 + a2) / 2;
    if (a1 < max or a1 > max + 1) {
        cout << "nemoguce";
    }
    else {
        if(a1 < a2){
            for(a1; a1 > 0; a1--) {
                rec = rec + c2 + c1;
                a2--;
            }
            if (a2 == 1) {
                rec = rec + c2;
            }
        }
        else{
            for(a2; a2 > 0; a2--) {
                rec = rec + c1 + c2;
                a1--;
            }
            if (a1 == 1) {
                rec = rec + c1;
            }
        }
        cout << rec;
    }
}