#include <iostream>
#include <string>

using namespace std;

int main()
{
    string s;
    cin>>s;
    char c1=s[0], c2=s[1];

    int a1, a2;
    cin>>a1>>a2;
    
    if((a1 + a2) % 2)
    //neparni ukupni broj slova
    {
    	if(a1 == a2 + 1)
    	{
    		cout<<c1;
    		for(int i=0; i<a2; i++)
    			cout<<c2<<c1;
		}
		else if(a2 == a1 + 1)
    	{
    		cout<<c2;
    		for(int i=0; i<a1; i++)
    			cout<<c1<<c2;
		}
		else
			cout<<"nemoguce";
	}
    else
    {
    	if(a1 == a2)
    		for(int i=0; i<a1; i++)
    			cout<<c1<<c2;
    	else
			cout<<"nemoguce";
	}
    return 0;
}