#include typedef long long ll; typedef unsigned long long ull; #define FOR(i,a,b) for(int (i)=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define RANGE(vec) (vec).begin(),(vec).end() using namespace std; class QueryOfNumberProductSet { public: void solve(void) { int L,M,N; cin>>L>>M>>N; bitset<100001> A; bitset<100001> B; REP(i,L) { int x; cin>>x; A.set(x); } REP(i,M) { int x; cin>>x; B.set(x); } int Q; cin>>Q; REP(v,Q) { // 加算によってビットが左にずれる cout<<(A & B<solve(); delete obj; return 0; } #endif