#include <bits/stdc++.h>
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define maxn 200050

using namespace std;
typedef long long ll;

char c1, c2;
int a1, a2;

int main()
{
	cin >> c1 >> c2 >> a1 >> a2;
	if(abs(a1-a2)>1)
    {
        cout << "nemoguce";
    }
    else
    {
        if(a1>a2)
        {
            cout << c1;
            for(int i=0; i<a2; i++)
            {
                cout << c2 << c1;
            }
        }
        else if(a2>a1)
        {
            cout << c2;
            for(int i=0; i<a1; i++)
            {
                cout << c1 << c2;
            }
        }
        else
        {
            for(int i=0; i<a1; i++)
            {
                cout << c1 << c2;
            }
        }
    }
}