#include <iostream>

using namespace std;

int main()
{


    char c1,c2;
    int a1,a2;
    cin>>c1>>c2;
    cin>>a1>>a2;
    if((a1+1)==a2)
    {
        cout<<c2;
        for(int i=1; i<=a1;i++)
            cout<<c1<<c2;
    }

    if((a2+1)==a1)
    {
        cout<<c1;
        for( int k=1; k<=a2;k++)
            cout<<c2<<c1;
    }
    if(a1==a2)
    {
        for( int j=1; j<=a1;j++)
            cout<<c1<<c2;
    }
    if(abs(a1-a2)>1)
        cout<<"nemoguce";


    return 0;
}