import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String[] first = sc.nextLine().split(" "); int L = Integer.parseInt(first[0]); int M = Integer.parseInt(first[1]); int N = Integer.parseInt(first[2]); boolean[] A = new boolean[N]; String[] aStrings = sc.nextLine().split(" "); for (int i = 0; i < aStrings.length; i++) { A[Integer.parseInt(aStrings[i]) - 1] = true; } boolean[] B = new boolean[N]; String[] bStrings = sc.nextLine().split(" "); for (int i = 0; i < bStrings.length; i++) { A[Integer.parseInt(bStrings[i]) - 1] = true; } int Q = sc.nextInt(); sc.close(); 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()); } }