#include <bits/stdc++.h>

using namespace std;

char c1,c2;
int a1,a2,amax,amin,j=1;

int main(){
    cin>>c1>>c2;
    cin>>a1>>a2;
    if(a1<a2) swap(a1,a2),swap(c1,c2);
    if(a1-a2>=2) cout<<"nemoguce"<<endl;
    else {for(int i=1;i<=a1;i++){
        cout<<c1;
        if (j<=a2) cout<<c2,j++;
        }
    }
    return 0;
}