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

int main() {
	string x;
	cin >> x;
	char a,b;
	a = x[0];
	b = x[1];
	int n,m;
	cin >> n >> m;
	if(n-1 == m) {
		for(int i = 0; i < n+m; ++i) {
			if(i % 2 == 0)cout << a;
			else cout << b;
		}
	}
	else if(n == m) {
		for(int i = 0; i < n+m; ++i) {
			if(i % 2 == 0)cout << a;
			else cout << b;
		}
	}
	else if(n+1 == m) {
		for(int i = 0; i < n+m; ++i) {
			if(i % 2 == 0)cout << b;
			else cout << a;
		}
	}
	else {
		cout << "nemoguce";
	}
	
}