#include <iostream>

using namespace std;

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