#include <iostream>
#include <cmath>
using namespace std;
int main(){
    string c;
    char c1,c2;
    long long a1,a2;
    cin>>c>>a1>>a2;
    c1=c[0];
    c2=c[1];
    if(abs(a1-a2)>1){
        cout<<"nemoguce";
        return 0;
    }
    if(a1==a2){
        for(int i=0;i<a1+a2;++i){
            if(i%2==0){
                cout<<c1;
            }
            else{
                cout<<c2;
            }
        }
    }
    if(a1>a2){
        for(int i=0;i<a1+a2;++i){
            if(i%2==0){
                cout<<c1;
            }
            else{
                cout<<c2;
            }
        }
    }
    if(a1<a2){
        for(int i=0;i<a1+a2;++i){
            if(i%2==0){
                cout<<c2;
            }
            else{
                cout<<c1;
            }
        }
    }
    return 0;
}