#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    char s[2];
    int a, b;
    cin>>s>>a>>b;
    if (a >= b + 2 || b >= a + 2){
        cout<<"nemoguce";
        return 0;
    }
    char c1 = s[0], c2 = s[1];
    if (b > a){
        char pom = c1;
        c1 = c2;
        c2 = pom;
    }
    char s2[a+b];
    for(int i=0;i<a+b;i++)
        s2[i] = (i & 1) ? c2 : c1;
    cout<<s2;
    return 0;
}