#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define sz(x) (int)(x).size()
#define all(x) x.begin(), x.end()
using namespace std;

const char nl='\n';
const int MOD=1000000007;
const int N=200005;

int a1,a2;
char c1,c2;

void solve(){
    cin>>c1>>c2>>a1>>a2;
    if(abs(a1-a2)>1)cout<<"nemoguce"<<nl;
    else{
       if(a1>a2){
           for(int i=1;i<=a1+a2;i++){
                if(i&1)cout<<c1;
                else cout<<c2;
           }
           cout<<nl;
       }
       else{
            for(int i=1;i<=a1+a2;i++){
                if(i&1)cout<<c2;
                else cout<<c1;
           }
           cout<<nl;
       }
    }
}
int main () {
cin.tie(NULL);
ios_base::sync_with_stdio(false);

int T=1;
//cin>>T;
while(T--){
    solve();
}

return 0;
}