#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++) using namespace std; typedef long long int ll; typedef vector VI; typedef pair PI; const double EPS=1e-9; const int N = 100010; int l, m, n; int a[N], b[N]; int u[2 * N + 1]; int q; int main(void){ cin >> l >> m >> n; set ss; REP(i, 0, l) { cin >> a[i]; ss.insert(a[i]); u[a[i]]++; } REP(i, 0, m) { cin >> b[i]; } sort(b, b + m); cin >> q; REP(v, 0, q) { int cnt = 0; REP(i, 0, m) { if (b[i] + v >= n + 1) { break; } cnt += u[b[i] + v]; } cout << cnt << endl; } }