#include #include #include using namespace atcoder; using mint = modint1000000007; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000000000000 int main(){ int L,M,N; cin>>L>>M>>N; bitset<100002> a,b; rep(i,L){ int t; cin>>t; a[t] = 1; } rep(i,M){ int t; cin>>t; b[t] = 1; } int Q; cin>>Q; rep(i,Q){ cout<<(a&(b<