#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <math.h>
#include <string>
#include <vector>
#include <chrono>
#include <random>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <assert.h>
#include <set>
#define endl '\n'

using namespace std;
using i64 = long long;
using ld = long double;

const i64 INF = 1e18 + 5;

mt19937 rnd(29);

const i64 S = 5005;
i64 a[S], b[S];

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	i64 N, n, M, m, k, q; cin >> N >> n >> M >> m >> k >> q;

	if (N < S && M < S) {
		i64 from = 0;
		for (i64 x = 1; x <= n; ++x) {
			i64 l, val; cin >> l >> val;
			for (i64 y = from + 1; y <= from + l; ++y) {
				a[y] = val;
			}
			from += l;
		}
		from = 0;
		for (i64 x = 1; x <= m; ++x) {
			i64 l, val; cin >> l >> val;
			for (i64 y = from + 1; y <= from + l; ++y) {
				b[y] = val;
			}
			from += l;
		}
		for (i64 x = 1; x <= q; ++x) {
			i64 prefA, prefB; cin >> prefA >> prefB;
			cout << "No" << endl;
		}
	}

	exit(0);
}