#include <bits/stdc++.h>
using namespace std;
int a,b;
char c1,c2;
int main(){
    cin >> c1 >> c2;
    cin >> a >> b;

    if(abs(a-b)>=2){
        cout << "nemoguce" << endl;
    }

    else if(a>b){
        cout << c1;
        for(int i=0;i<(a+b-1)/2; i++){
            cout << c2 << c1;
        }
    }
    else if(b>a){
        cout << c2;
        for(int i=0;i<(a+b-1)/2;i++){
            cout << c1 << c2;
        }
    }
    else {
        for(int i=0;i<(a+b)/2;i++){
            cout << c1 << c2;
        }
    }
    cout << endl;


    return 0;
}