#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define int long long
using namespace std;
using namespace __gnu_pbds;

#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

mt19937_64 rnd(1488);

signed main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(0);
    //cout.tie(0);
    int N, M, n, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<vector<bool>> DP(N + 1, vector<bool> (M + 1, 0));
    vector<vector<int>> nxtN(N, vector<int> (k, N)), nxtM(M, vector<int> (k, M));
    vector<pair<int, int>> Nn, Mn;
    int st = 0;
    for (int i = 0; i < n; ++i) {
        int x;
        int y;
        cin >> x >> y;
        Nn.push_back({st, y - 1});
        st += x;
    }
    st = 0;
    for (int i = 0; i < m; ++i) {
        int x;
        int y;
        cin >> x >> y;
        Mn.push_back({st, y - 1});
        st += x;
    }
    vector<int> lst(k, N);
    int l = n - 1;
    for (int i = N - 1; i >= 0; --i) {
        if (i < Nn[l].first) {
            --l;
        }
        lst[Nn[l].second] = i;
        for (int j = 0; j < k; ++j) {
            nxtN[i][j] = lst[j] + 1;
        }
    }
    lst.assign(k, M);
    l = m - 1;
    for (int i = M - 1; i >= 0; --i) {
        if (i < Mn[l].first) {
            --l;
        }
        lst[Mn[l].second] = i;
        for (int j = 0; j < k; ++j) {
            nxtM[i][j] = lst[j] + 1;
        }
    }
    for (int i = N - 1; i >= 0; --i) {
        for (int j = M - 1; j >= 0; --j) {
            bool fl = 0;
            for (int k1 = 0; k1 < k; ++k) {
                if (nxtN[i][k1] < N + 1 && nxtM[j][k1] < M + 1 && 0 == DP[nxtN[i][k1]][nxtM[j][k1]]) {
                    fl = 1;
                }
                break;
            }
            DP[i][j] = fl;
        }
    }
    for (int i = 0; i < q; ++i) {
        int x, y;
        cin >> x >> y;
        if (DP[x][y]) {
            cout << "Yes";
        } else {
            cout << "No";
        }
        cout << endl;
    }
    for (auto i : DP) {
        for (auto j : i) {
            cout << j << ' ';
        }
        cout << endl;
    }
    cout << endl;
    for (auto i : nxtN) {
        for (auto j : i) {
            cout << j << ' ';
        }
        cout << endl;
    }
    cout << endl;
    for (auto i : nxtM) {
        for (auto j : i) {
            cout << j << ' ';
        }
        cout << endl;
    }
    cout << endl;
}

