#include <bits/stdc++.h>
using namespace std;
char c1,c2;
int a1,a2,zbir;
int main() {
    cin >> c1 >> c2;
    cin >> a1 >> a2;
    zbir=a1+a2;
    if (abs(a1-a2)>=2){
        cout << "nemoguce" << endl;
    }

    else {
        if (a1%2==0 and a2%2==0){
            for (int i=0;i<zbir;i++){
                if (i%2==0) {
                    cout << c1;
                }
                else {
                    cout << c2;
                }
            }
        }

        if (a1%2!=0 and a2%2==0){
            for (int i=0;i<zbir;i++){
                if (i%2==1) {
                    cout << c2;
                }
                else {
                    cout << c1;
                }
            }
        }

        if (a1%2==0 and a2%2!=0){
            for (int i=0;i<zbir;i++){
                if (i%2==1){
                    cout << c1;
                }
                else {
                    cout << c2;
                }
            }
        }

        if (a1%2!=0 and a2%2!=0 and zbir%2==0) {
            for (int i=0;i<zbir;i++){
                if (i%2==0){
                    cout << c1;
                }
                else {
                    cout << c2;
                }
            }
        }
    }

    return 0;
}