#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define die(x) { cout << x; return 0; }
#define int lint

using namespace std;
typedef long long lint;
typedef long long ll;
typedef pair<int, int> pii;

const int inf = 1000*1000*1000 + 7, Nmax = 1e5+1;

int suml = 0, sumr = 0, sumM = 0;
int m, l, w;
bool check(int curl, int curr, int curM) {
    return (curl-curr >= -l*(curM + m) && curl-curr <= l*(curM + m));
}

pii answer(vector<pii> l, vector<pii> r) {
    int a = 0, b = 0;
    bool ch1 = true, ch2 = true;
    while(ch1 || ch2)  {
        ch1 = false, ch2 = false;
        while(l.size() > 0 && check(suml - l.back().second, sumr, sumM-l.back().first)) {
            suml -= l.back().second;
            sumM -= l.back().first;
            l.pop_back();
            ch1 = true;
            b++;
        }
        if(ch1)
            a++;
        while(r.size() > 0 && check(suml, -r.back().second + sumr, sumM - r.back().first)) {
            sumr -= r.back().second;
            sumM -= r.back().first;
            r.pop_back();
            ch2 = true;
            b++;
        }
        if(ch2)
            a++;
    }
    return pii(b, -max(a-1, 0ll));
}

vector<pii> leftik, rightik;
signed main() {
    cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
    int n, k, hV;
    cin >> m >> l >> w >> n >> k;
    for(int i = 0;i < n;++i) {
        cin >> hV;
        leftik.push_back(pii(hV, (l+w + i*2*w)*hV));
        suml += (l+w + i*2*w)*hV;
        sumM += hV;

    }
    for(int i = 0;i < k;++i) {
        cin >> hV;
        rightik.push_back(pii(hV, (l+w + i*2*w)*hV));
        sumr += (l+w + i*2*w)*hV;
        sumM += hV;
    }

    pii ans = max(answer(leftik, rightik), answer(rightik, leftik));
    cout << ans.first << ' ' << -ans.second << '\n';


}
