#include using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int L, M, N; cin >> L >> M >> N; vector a(L), b(M); for (int i = 0; i < L; i++) cin >> a[i]; for (int i = 0; i < M; i++) cin >> b[i]; int Q; cin >> Q; sort(a.begin(), a.end()); sort(b.begin(), b.end()); vector cnt(Q, 0); deque dq; for (int i = 0, j = 0; i < L; i++) { while (j < M) { if (a[i] < b[j]) break; dq.push_back(b[j]); j++; } while (!dq.empty()) { if (dq.front() + Q > a[i]) break; dq.pop_front(); } for (int x : dq) cnt[a[i] - x]++; } for (int i = 0; i < Q; i++) { cout << cnt[i] << endl; } return 0; }