import bisect def main(): import sys input = sys.stdin.read().split() idx = 0 L = int(input[idx]); idx +=1 M = int(input[idx]); idx +=1 N = int(input[idx]); idx +=1 A = list(map(int, input[idx:idx+L])) idx +=L B = list(map(int, input[idx:idx+M])) idx +=M Q = int(input[idx]); idx +=1 B_sorted = sorted(B) count = [0] * Q for x in A: lower = x - (Q - 1) upper = x left = bisect.bisect_left(B_sorted, lower) right_idx = bisect.bisect_right(B_sorted, upper) for s in B_sorted[left:right_idx]: v = x - s if 0 <= v < Q: count[v] += 1 for v in range(Q): print(count[v]) if __name__ == '__main__': main()