#include<bits\stdc++.h>
using namespace std;


int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	string pera, petra, p3;
	int p1, p2;
	cin >> pera >> petra;
	cin >> p1 >> p2;
	if (p1 >= p2+2 || p2 >= p1 +2)
	{
		cout << "nemoguce" << "\n";
		return 0;
	}
	for ( int i = 0; i < (p1 + p2) / 2; i ++)
	{
		p3 += pera;
		p3 += petra;	
	}
	if ( p1 > p2)
	{
	    p3 += pera;
	}
	else if ( p2 > p1)
	{
	p3 = petra + p3;
	}
	cout << p3;
	return 0;
}