#include <bits/stdc++.h>

using namespace std;

bool CanMakeThisFuckingThing(double M, double L, double W, vector<double>B, vector<double>A) {
    double SumB1 = 0, SumB2 = 0;
    for (int i = 0; i < B.size(); ++i) {
        SumB1 += B[i];
        SumB2 += B[i]*(2*i-1);
    }

    double SumA1 = 0, SumA2 = 0;
    for (int i = 0; i < A.size(); ++i) {
        SumA1 += A[i];
        SumB2 += A[i] * (2*i-1);
    }

    return L * (M/2 + SumB1) > W * (SumA2 - SumB2);
}

bool CanDo2 (double M, double L, double W, vector<double>B, vector<double>A, int mode) {
    if(mode == 0) {
        if(A.size()==0)
            return false;
        else A.pop_back();
    }

    if(mode == 1) {
        if (B.size() == 0)
            return false;
        else B.pop_back();
    }
    return CanMakeThisFuckingThing(M, L, W, B, A);
}

int main()
{
    double M, L, W, N, K;
    cin >> M >> L >> W >> N >> K;
    vector<double> A, B;
    vector<double> A0, B0;
    A.resize(N); B.resize(K); A0.resize(N); B0.resize(K);
    for (int i = 0; i < N; ++i) cin >> A[i];
    for (int i = 0; i < K; ++i) cin >> B[i];

    int CanRemoveN = 0, CanRemoveK = 0;

    for (int i = 0; i < N; ++i) A0[i] = A[i];
    for (int j = 0; j < K; ++j) A0[j] = A[j];

    while (CanMakeThisFuckingThing(M, L, W, B0, A0) && A0.size() > 0) {
        CanRemoveN++; A0.pop_back();
    }
    while (CanMakeThisFuckingThing(M, L, W, B0, A) && B0.size() > 0) {
        CanRemoveK++; B0.pop_back();
    }

    int mode = 0;

    int steps = 0, res = 0;

    vector<double> A2, B2; A2.resize(N); B2.resize(K);
    for (int i = 0; i < N; ++i) A2[i] = A[i];
    for (int j = 0; j < K; ++j) B2[j] = B[j];

    while (CanDo2(M, L, W, B, A, 0) || CanDo2(M, L, W, B, A, 1)) {
        if (mode == 0) {
            if (!CanDo2(M, L, W, B, A, 0)) {
                mode = 1; ++steps; continue;
            }
            else {
                A.pop_back();
                ++res;
                continue;
            }
        }
        else {
            if (!CanDo2(M, L, W, B, A, 1)) {
                mode = 0; ++steps; continue;
            }
            else {
                B.pop_back();
                ++res;
                continue;
            }
        }
    }
    mode = 1;
    int steps2 = 0, res2 = 0;

    while (CanDo2(M, L, W, B2, A2, 0) || CanDo2(M, L, W, B2, A2, 1)) {
        if (mode == 0) {
            if (!CanDo2(M, L, W, B2, A2, 0)) {
                mode = 1; ++steps2; continue;
            }
            else {
                A2.pop_back();
                ++res2;
                continue;
            }
        }
        else {
            if (!CanDo2(M, L, W, B2, A2, 1)) {
                mode = 0; ++steps2; continue;
            }
            else {
                B2.pop_back();
                ++res2;
                continue;
            }
        }
    }
    if (res >= res2) {
        cout << res << " " << steps;
    }
    else cout << res2 << " " << steps2;
}
