#include #include #define repeat(i,n) for (int i = 0; (i) < (n); ++(i)) using namespace std; const int MAX_N = 100000; int main() { int l, m, n; cin >> l >> m >> n; bitset a; repeat (i,l) { int j; cin >> j; a[j-1] = true; } bitset b; repeat (i,m) { int j; cin >> j; b[j-1] = true; } int q; cin >> q; repeat (i,q) cout << (a & (b << i)).count() << endl; return 0; }