#include #include #include #include #include #include #include #include #include #include using namespace std; //#define __int64 long long #define long __int64 #define REP(i,a,b) for(int i=a;i a; bitset<200000> b; bitset<200000> c; cin >> a_len >> b_len >> n; for(int i=0; i> in; a[in-1] = true; } for(int i=0; i> in; b[in-1] = true; } cin >> q; for(int i=0; i