#include <bits/stdc++.h>

using namespace std;

int main()
{
    string s;
    char c1,c2,c;
    int n1,n2,n;
    getline(cin,s);
    c1 = s[0];
    c2 = s[1];
    cin>>n1>>n2;
    if(abs(n1-n2)>1){
        cout<<"nemoguce"<<endl;
        return 0;
    }
    if(n2>n1){
        c = c1;
        c1 = c2;
        c2 = c;
        n = n1;
        n1 = n2;
        n2 = n;
    }
    for(int i =0; i<n1+n2; i++){
        if(i%2==0){
            cout<<c1;
        }
        else{
            cout<<c2;
        }
    }
    return 0;
}