#include <bits/stdc++.h> 
#include <iostream>
#include <string>

using namespace std;

int CHAR_LENGTH = 1;

int main()
{
	char c1, c2;
	
	cin >> c1 >> c2;
	
	int a1, a2;
	
	cin >> a1 >> a2;
	
	string u;
	
    string s1(1, c1);
    
    string s2(1, c2);
    
    int max;
    max=a1;
    if (a2>max) max=a2;

	if (a1 >= a2+2 || a2 >= a1+2) cout << "nemoguce";

	else if (a1 != a2) {
		
		for (int i=0; i<=max-2; i++){
			
			u=s1+s2;
			cout << u;
			}
		if (a1==max) cout << s1;
		else cout << s2;
		}
	else for (int i=0; i<max; i++){
		
			u=s1+s2;
			cout << u;
	}

	return 0;
	
}