#include <iostream>
#include <cstdio>
using namespace std;

int main() {

    char c1, c2;
    int a1, a2;
    string s;
    scanf("%c0", &c1);
    scanf("%c0", &c2);
    scanf("%i1", &a1);
    scanf("%i0", &a2);

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

    return 0;
}