#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define endl "\n"
#define vi vector <int>
#define vd vector <double>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    char c1,c2;
    cin>>c1>>c2;
    int a1,a2;
    cin>>a1>>a2;
    if(abs(a1-a2)>1)
    {
        cout<<"nemoguce";
        return 0;
    }
    else if(a1-a2==1)
    {
        for(int i=0;i<a2;i++)
            cout<<c1<<c2;
        cout<<c1;
    }
    else if(a2-a1==1)
        {
           for(int i=0;i<a1;i++)
            cout<<c2<<c1;
            cout<<c2;
        }
    else
    {
        for(int i=0;i<a1;i++)
            cout<<c1<<c2;
    }
	return 0;
}