#include using namespace std; #define bokusunny ios::sync_with_stdio(false), cin.tie(nullptr); void solve() { int L, M, N; cin >> L >> M >> N; bitset<100010> A, B; for (int i = 0; i < L; i++) { int a; cin >> a; A.set(a); } for (int i = 0; i < M; i++) { int b; cin >> b; B.set(b); } int Q; cin >> Q; for (int v = 0; v < Q; v++) { cout << (A & B).count() << endl; B <<= 1; } } int main() { bokusunny; solve(); return 0; }