#include <bits/stdc++.h>
#define int long long
#define F first
#define S second
#define pb push_back

using namespace std;

void solve() {
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    for(int i = 1; i <= n; i++) {
        int l, v;
        cin >> l >> v;
    }
    for(int i = 1; i <= m; i++) {
        int l, v;
        cin >> l >> v;
    }
    while(q--) {
        int x, y;
        cin >> x >> y;
        cout << "No\n";
    }
}

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif // LOCAL
    int t = 1;
    //cin >> t;
    while(t--) {
        solve();
    }
}


