#include using namespace std; int main() { int L, M, N; cin >> L >> M >> N; bitset<100000> X, Y; for (int i = 0; i < L; i++) { int a; cin >> a; X[a - 1] = true; } for (int i = 0; i < M; i++) { int b; cin >> b; Y[b - 1] = true; } int Q; cin >> Q; for (int v = 0; v < Q; v++) { cout << (X & (Y << v)).count() << endl; } }