import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(max(1000, 10**9)) write = lambda x: sys.stdout.write(x+"\n") l,m,n = list(map(int, input().split())) aa = list(map(int, input().split())) bb = list(map(int, input().split())) q = int(input()) a = [0]*n b = [0]*n for i in range(l): a[aa[i]-1] = 1 for i in range(m): b[bb[i]-1] = 1 b = b[::-1] # FFT import numpy as np M = 998244353 a = np.array(a, dtype=np.int64) b = np.array(b, dtype=np.int64) def fft(a,b): l = 1 while 2 * l < len(a) + len(b) - 1: l *= 2 l *= 2 c = np.fft.irfft((np.fft.rfft(a,l))*(np.fft.rfft(b,l)),l) c = np.rint(c).astype(np.int64) return c def fft_large(a,b): d = 30000 a1, a2 = np.divmod(a,d) b1, b2 = np.divmod(b,d) aa = fft(a1,b1) bb = fft(a2,b2) cc = (fft(a1+a2, b1+b2) - (aa+bb)) h = (((aa*d))*d + cc*d + bb) return h c = fft(a,b) write("\n".join(map(str, c[n-1:n-1+q].tolist())))