#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string>
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    char a, b;
    string s;
    int x,y;
    cin>>s>>x>>y;
    a=s[0];
    b=s[1];
    if(abs(x-y)>1){
        cout<<"nemoguce";
        return 0;
    }

    if(x>y){
        cout<<a;
        x--;
        while(x>0){
            cout<<b<<a;
            x--;
            y--;
        }
    }

    else if(y>x){
        cout<<b;
        x--;
        while(x>0){
            cout<<a<<b;
            x--;
            y--;
        }
    }

    else while(x>0){
        cout<<a<<b;
        x--;
        y--;
    }
    return 0;
}