#include <iostream>
#include <string.h>
#include <cmath>

using namespace std;

int main()
{
	ios::sync_with_stdio(false);

	char a, b;
	int a_, b_;

	cin >> a >> b;
	cin >> a_ >> b_;

	if (abs(a_ - b_) <= 1)
	{
		if (a_ == b_)
		{
			for (int i = 0; i < a_; i++)
			{
				putchar(b);
				putchar(a);
			}
		}
		else
		{
			if (a_ > b_)
			{
				putchar(a);
				for (int i = 0; i < a_ - 1; i++)
				{
					putchar(b);
					putchar(a);
				}
			}
			else
			{
				putchar(b);
				for (int i = 0; i < b_ - 1; i++)
				{
					putchar(a);
					putchar(b);
				}
			}
		}
	}
	else
	{
		cout << "nemoguce";
	}
}