#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    char c1, c2;
    int a1, a2;
    cin >> c1;
    cin >> c2;
    cin >> a1;
    cin >> a2;
    if ( abs(a2 - a1) > 1)
    {
        cout << "nemoguce" << endl;
        return 0;
    }
    if (a1 > a2)
    {
        for (int i = 0; i < (a1 + a2) / 2; i++)
            cout << c1 << c2;
        if ((a1 + a2) % 2 == 1)
            cout << c1;
    }
    if (a2 > a1)
    {
        for (int i = 0; i < (a1 + a2) / 2; i++)
            cout << c2 << c1;
        if((a1 + a2) % 2 == 1)
            cout << c2;
     if (a2 == a1)
    {
        for (int i = 0; i < (a1 + a2) / 2; i++)
            cout << c1 << c2;
    return 0;
     
}