#include <iostream>
using namespace std;
int main() {
    char c1,c2;
    cin>>c1>>c2;
    int a1,a2;
    cin>>a1>>a2;
    if(abs(a1-a2) <= 1) 
    {
        int t = a1>a2;
        string str;
        int i = 0;
        while(i++<a1+a2) {
            str.push_back(t?c1:c2);
            t = !t;
        }
        cout<<str<<endl;
    }
    else   
        cout<<"nemoguce"<<endl;
}