n=int(eval(input()))



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



memo = [0]*(2+10**5)



for a in t:

    memo[a-1] += 1

    memo[a] += 1

    memo[a+1] += 1

print((max(memo)))
N = int(eval(input()))



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



memo = [0]*(2+10**5)



for i in range(N):

    tmp = a[i]

    memo[tmp-1] += 1

    memo[tmp] += 1

    memo[tmp+1] += 1



ans = max(memo)



print(ans)
n = int(eval(input()))
t = list(map(int, input().split()))
memo = [0] * (2 + 10**5)
for a in t:
    memo[a - 1] += 1
    memo[a] += 1
    memo[a + 1] += 1
print((max(memo)))

N = int(eval(input()))
a = list(map(int, input().split()))
memo = [0] * (2 + 10**5)
for i in range(N):
    tmp = a[i]
    memo[tmp - 1] += 1
    memo[tmp] += 1
    memo[tmp + 1] += 1
ans = max(memo)
print(ans)

-n = int(eval(input())) -t = list(map(int, input().split())) +N = int(eval(input())) +a = list(map(int, input().split())) -for a in t: -    memo[a - 1] += 1 -    memo[a] += 1 -    memo[a + 1] += 1 -print((max(memo))) +for i in range(N): +    tmp = a[i] +    memo[tmp - 1] += 1 +    memo[tmp] += 1 +    memo[tmp + 1] += 1 +ans = max(memo) +print(ans)