#include <bits/stdc++.h>

using namespace std;

string s;

int main()
{
	cin >> s;
	
	int n1, n2; cin >> n1 >> n2;
	
	if(abs(n1 - n2) > 1) cout << "nemoguce";
	else
	{	
		if(n1 == n2 - 1) cout << s[1];
		
		for(int i = 0 ; i < n1 - 1; i++) cout << s[0] << s[1];
		
		cout << s[0];
		
		if(n1 <= n2) cout << s[1];
	}
	
	return 0;
}