#include <iostream>
#include <string>

using namespace std;

int main()
{
    string slova;
    int br_pon1, br_pon2;

    getline(cin, slova);
    cin >> br_pon1 >> br_pon2;

    char a = slova[0];
    char b = slova[1];

    if(br_pon1 > br_pon2+1 || br_pon2 > br_pon1+1)
    {
        cout << "nemoguce" << endl;
    }

    else
    {
        for(int i = 0; i<br_pon1+br_pon2; i++)
        {
            if(br_pon1 > br_pon2)
            {
                if(i%2==0)
                {
                    cout << a;
                }
                else
                {
                    cout << b;
                }
            }
            else
            {
                if(i%2==0)
                {
                    cout << b;
                }
                else
                {
                    cout << a;
                }
            }
        }
        cout << endl;
    }
    return 0;
}