#include <iostream>
#define ll long long
using namespace std;

ll m, l, w, n, k, moml, momr, mc, nc, mr, ml, nr, nl;
void turn(ll ri[], ll le[], ll n, ll k)
{
    if (n+k==0)
        return;
    ll i=n-1;
    while (i>=0)
        if (moml-(2*l+w+i*2*w)*ri[i]>=0)
        {
            moml-=(2*l+w+i*2*w)*ri[i];
            momr+=(w+i*2*w)*ri[i];
            mc++;
            i--;
        }
        else break;
    if (momr-(2*l-w+k*2*w)*le[i]>=0)
    {
        nc++;
        swap(moml, momr);
        turn(le, ri, k, i+1);
    }
}
ll getmom(ll ri[], ll le[], ll n, ll k)
{
    ll lenr=l*2+w, lenl=w, i;
    ll res=m*l;
    for (i=0; i<n; i++)
    {
        res+=ri[i]*lenr;
        lenr+=2*w;
    }
    for (i=0; i<k; i++)
    {
        res-=le[i]*lenl;
        lenl+=2*w;
    }
    return res;
}
int main(void)
{
    cin>>m>>l>>w>>n>>k;
    ll left[k];
    ll right[n];
    for (ll i=0; i<k; i++)
        cin>>left[i];
    for (ll i=0; i<n; i++)
        cin>>right[i];
    moml=getmom(right, left, n,k);
    momr=getmom(left, right, k, n);
    mc=0; nc=0;
    turn(left, right, k,n);
    ml=mc;
    nl=nc;
    mc=0; nc=0;
    moml=getmom(right, left, n,k);
    momr=getmom(left, right, k, n);
    turn(right, left, n,k);
    mr=mc;
    nr=nc;
    if (mr>ml) cout<<mr<<" "<<nr<<endl;
    else if (mr<ml) cout<<ml<<" "<<nl<<endl;
    else if (nl<nr) cout<<ml<<" "<<nl<<endl;
    else cout<<mr<<" "<<nr<<endl;
}
