#include <bits/stdc++.h>

using namespace std;

int main()
{
    char c1, c2, cMax, cMin;
    unsigned a1, a2, aMax, aMin, aLength;
    cin >> c1 >> c2 >> a1 >> a2;
    aMax = max(a1, a2);
    aMin = min(a1, a2);
    if(aMax > aMin + 1)
    {
        cout << "nemoguce";
        return 0;
    }
    aLength = a1 + a2;
    if(aMax == a1)
    {
        cMax = c1;
        cMin = c2;
    }
    else
    {
        cMax = c2;
        cMin = c1;
    }
    for(unsigned i = 0; i < aLength; i++)
    {
        if(i % 2 == 0)
            cout << cMax;
        else
            cout << cMin;
    }
}