#include <iostream>

using namespace std;

void p_string (char &a,char &b,int n)
{
    char p[1000];
    char t = '\0';
    for (int i=0;i<n;i++)
    {
        if (t == a)
            p[i] = b;
        else
            p[i] = a;
        t = p[i];
        cout << p[i];
    }

}

int main()
{
    char c[2];
    int a1,a2,n,t;
    for (int i=0;i<2;i++)
        cin >> c[i];
    cin >> a1 >> a2;
    t = a1 - a2;
    n = a1 + a2;
    switch (t)
    {
         case 0:
             p_string (c[0],c[1],n);
             break;
         case 1:
             p_string (c[0],c[1],n);
             break;
         case -1:
             p_string (c[1],c[0],n);
             break;
         default:
             cout << "nemoguce";
             break;

    }
    return 0;
}