#include<bits\stdc++.h>
#define ff(i,n) for(int i = 0; i<n; i++)
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //cout.tie(NULL);
    string s; cin>>s;
    char a = s[0];
    char b = s[1];
    int x; int y;
    cin>>x>>y;
    if(x>y){
        if(x==y+1){
            ff(i,y) cout<<a<<b;
            cout<<a;
        }
        else cout<<"nemoguce";
    }
    else{
        if(x==y) ff(i,x) cout<<a<<b;
        else if(x+1==y){
            ff(i,x) cout<<b<<a;
            cout<<b;;
        }
        else cout<<"nemoguce";
    }
    return 0;
}