#include <bits/stdc++.h>
#define en "\n"
typedef long long ll;
typedef long double ld;
using namespace std;
vector <int> LEFT, RIGHT;
int M,LE,W,N,K;
ll check(int l, int r){

    ll rez = 0;
    ll rez2=M;
    for(int i = 0; i<l; i++)
    {
        rez-=(LEFT[i])*(LE+2*W*i+W);
        rez2+=LEFT[i];
    }
    for(int i = 0; i<r; i++)
    {
        rez+=RIGHT[i]*(LE+2*W*i+W);
        rez2+=RIGHT[i];
    }
    return abs(rez)<=LE*rez2;
}
int main()
{

    cin>>M>>LE>>W>>N>>K;\
    int R=N;
    int L=K;
    int x;
    for (int i=0; i<N; ++i){
        cin>>x;
        RIGHT.push_back(x);
    }

    for (int i=0; i<K; ++i){
        cin>>x;
        LEFT.push_back(x);
    }
    int ans1=0,ans2=0;
    int cnt1=0,cnt2=0;
    bool wh=1; ///1==left 0==right
    while ((L>0 && check(L-1,R)) || (R>0 && check(L,R-1))){
        ++ans1;
        //cout<<"HELLO1";
        if (wh){
            int l=0;
            int r=L;
            if (check(L-r,R)){
                cnt1+=r;
                L-=r;
            }
            else{
                while (l+1<r){
                    int m=(l+r)/2;
                    if (check(L-m,R))
                        l=m;
                    else
                        r=m;

            }
            L-=l;
            cnt1+=l;
            }
        }else{
            int l=0;
            int r=R;
            if (check(L,R-r)){
                cnt1+=r;
                R-=r;
            }else{
            while (l+1<r){
                int m=(l+r)/2;
                if (check(L,R-m))
                    l=m;
                else
                    r=m;
            }
            cnt1+=l;
            R-=l;
            }
        }
        wh=1-wh;
    }
    R=N;
    L=K;
    wh=0; ///1==left 0==right
    while ((L>0 && check(L-1,R)) || (R>0 && check(L,R-1))){
            //cout<<"HELLO2";
        ++ans2;
        if (wh){
            int l=0;
            int r=L;
            if (check(L-r,R)){
                cnt2+=r;
                L-=r;
            }else{
             while (l+1<r){
                int m=(l+r)/2;
                if (check(L-m,R))
                    l=m;
                else
                    r=m;

            }
            cnt2+=l;
            L-=l;
            }
        }else{
            int l=0;
            int r=R;
            if (check(L,R-r)){
                cnt2+=r;
                R-=r;
            }else{
            while (l+1<r){
                int m=(l+r)/2;
                if (check(L,R-m))
                    l=m;
                else
                    r=m;

            }
                    cnt2+=l;
                    R-=l;
            }

        }
        wh=1-wh;
    }
    --ans1,--ans2;
    if (cnt1==cnt2){
        cout<<(cnt1,cnt2)<<" "<<min(ans1,ans2)<<en;
    }else
    if (cnt1>cnt2){
        cout<<cnt1<<" "<<ans1<<en;
    }
    else
        cout<<cnt2<<" "<<ans2<<en;
}
