#include <iostream>
#include <vector>
#include <numeric>
#include <sstream>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <cmath>
#include <iterator>
#include <climits>
#define watch(x) cout<<(#x)<<" is: "<<(x)<<endl
using namespace std;
typedef long long ll;


int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	char c1, c2;
	int a1, a2;
	cin>>c1>>c2>>a1>>a2;
	if(((a1 - a2) >= 2) || ((a2 - a1) >= 2))
        cout<<"nemoguce";
    else
    {
        for(int i = 0; i < (a1 + a2); ++i)
        {
            if(a1 >= a2)
            {
                if(i&1 != 0) //neparan
                    cout<<c2;
                else
                    cout<<c1;
            }
            else
            {
                if(i&1 != 0) //neparan
                    cout<<c1;
                else
                    cout<<c2;
            }
        }
    }
}