import java.io.IOException; public class Main { public static void main(String[] args) { int L = nextInt(); int M = nextInt(); int N = nextInt(); boolean[] A = new boolean[N]; for (int i = 0; i < L; i++) { A[nextInt() - 1] = true; } boolean[] B = new boolean[N]; for (int i = 0; i < M; i++) { B[nextInt() - 1] = true; } int Q = nextInt(); int[] cnt = new int[Q]; for (int i = 0; i < N; i++) { for (int q = 0; q < Q; q++) { if (i + q >= N) { break; } if (A[i + q] && B[i]) { cnt[q]++; } } } StringBuilder sb = new StringBuilder(); for (int i = 0; i < cnt.length; i++) { sb.append(cnt[i]); sb.append("\n"); } System.out.println(sb.toString()); } static int nextInt() { int c; try { c = System.in.read(); while (c != '-' && (c < '0' || c > '9')) c = System.in.read(); if (c == '-') return -nextInt(); int res = 0; while (c >= '0' && c <= '9') { res = res * 10 + c - '0'; c = System.in.read(); } return res; } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return -1; } }