#include<bits/stdc++.h>
using namespace std;
char a,b;
int n1;
int n2;
int main(){
    cin>>a>>b>>n1>>n2;
  if(n1-n2==0){
    for(int i=1;i<=n1;i++){
        cout<<a;
        cout<<b;

        }
        }

        if(n1<n2){
        swap(n1,n2);
        swap(a,b);
        if(n1-n2>=2){
            cout<<"nemoguce";}

        else if(n1-n2<2){
                cout<<b;
            for(int i=1;i<=n1-1;i++){
                cout<<a;
                cout<<b;
            }

        }
        }

return 0;
}