#include <bits/stdc++.h>
using namespace std;
#define MOD 18446744073709551616
int T,  //test point
    n,  //amount of people attending <=250000
    a[250010],  //XiaoN's team members' program design level <=n(250000)
    b[250010],  //XiaoO's team members' program design level <=n(250000)
    Q,          //time of matches <=250000
    l[250010],
    r[250010];
int main() {
    freopen("match.in", "r", stdin);
    freopen("match.out", "w", stdout);
    cin >> T >> n;              //Line 1
    for(int i=1; i<=n; ++i) {   //Line 2
        cin >> a[i];
    }
    for(int i=1; i<=n; ++i) {   //Line 3
        cin >> b[i];
    }
    cin >> Q;                   //Line 4
    for(int i=1; i<=Q; ++i) {   //Line 5 - Line Q + 5
        cin >> l[i] >> r[i];
    }

    return 0;
}