#include <bits/stdc++.h>

using namespace std;

int main()
{
    char a, b;
    int n, m;
    cin >> a >> b >> n >> m;

    int s = n + m;

    if(n - m > 1 || m - n > 1)
        cout << "nemoguce" << endl;

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

        else {
            for(int i = 0; i < s; i++) {
                if(i % 2 == 0)
                    cout << a;
                else
                    cout << b; } } }

    return 0;
}