#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];
    string slova1(br_pon1, a);
    string slova2(br_pon2, b);

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

    else
    {
        for(int i = 0, s = 0; i<br_pon1, s<br_pon2; i++, s++)
        {
            if(br_pon1>br_pon2)
            {
                if(s == br_pon2)
                {
                    cout << slova1[i];
                }
                else
                {
                    cout << slova1[i] << slova2[s];
                }
            }
            else
            {
                if(i == br_pon1)
                {
                    cout << slova2[s];
                }
                else
                {
                    cout << slova2[s] << slova1[i];
                }
            }
        }
        cout << endl;
    }
    return 0;
}