#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{

    int i,m,n;
    char a,b;
    cin>>a>>b>>m>>n;
	switch(m-n)
	{
		case 0: for(i=0;i<m;i++) cout<<a<<" "<<b<< " "; break;
		case 1: for(i=0;i<n;i++) cout<<a<< " "<<b<< " "; cout<<a; break;
		case -1: cout<<b<< " "; for(i=0;i<m;i++) cout<<a<< " "<<b<< " "; break;
		default: cout<<"nemoguce";
	}
	system("pause");
	return 0;
}