n,a=int(eval(input())),list(map(int,input().split()));c=[0]*(max(a)+1)

for i in a:

  if i>0:c[i-1]+=1

  if i<len(c)-1:c[i+1]+=1

  c[i]+=1

print((max(c)))
n=int(eval(input()))

a=list(map(int,input().split()))

b=[0]*100007

for i in a:

  b[i-1]+=1

  b[i]+=1

  b[i+1]+=1

print((max(b)))
n, a = int(eval(input())), list(map(int, input().split()))
c = [0] * (max(a) + 1)
for i in a:
    if i > 0:
        c[i - 1] += 1
    if i < len(c) - 1:
        c[i + 1] += 1
    c[i] += 1
print((max(c)))

n = int(eval(input()))
a = list(map(int, input().split()))
b = [0] * 100007
for i in a:
    b[i - 1] += 1
    b[i] += 1
    b[i + 1] += 1
print((max(b)))

-n, a = int(eval(input())), list(map(int, input().split())) -c = [0] * (max(a) + 1) +n = int(eval(input())) +a = list(map(int, input().split())) +b = [0] * 100007 -    if i > 0: -        c[i - 1] += 1 -    if i < len(c) - 1: -        c[i + 1] += 1 -    c[i] += 1 -print((max(c))) +    b[i - 1] += 1 +    b[i] += 1 +    b[i + 1] += 1 +print((max(b)))