#include <bits/stdc++.h>
using namespace std;
int n, m;
char a, b;
int main() {
cin >> a >> b >> n >> m;
int suma = n+m;
string s;

if (suma%2 == 0) {
    if (n == m) {
        for (int i = 0; i < n+m; i+=2) {
            cout<<a<<b;
        }
        return 0;
    }
} else {
    if (n+1 == m) {
        for (int i = 1; i < n+m; i+=2) {
            cout<<a<<b;
        } cout<<a;
        return 0;
    }

    if (n == m+1) {
        for (int i = 1; i < n+m; i += 2) {
            cout<<b<<a;
        }cout<<b;
        return 0;
    }
}

cout << "nemoguce" << endl;
return 0;
}