N = int(eval(input()))

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

cnt = [0]*(10**7)

for i in a:

    cnt[i-1] += 1

    cnt[i] += 1

    cnt[i+1] += 1

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

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

cnt = [0]*(10**6)

for i in a:

    cnt[i-1] += 1

    cnt[i] += 1

    cnt[i+1] += 1

print((max(cnt)))
N = int(eval(input()))
a = list(map(int, input().split()))
cnt = [0] * (10**7)
for i in a:
    cnt[i - 1] += 1
    cnt[i] += 1
    cnt[i + 1] += 1
print((max(cnt)))

N = int(eval(input()))
a = list(map(int, input().split()))
cnt = [0] * (10**6)
for i in a:
    cnt[i - 1] += 1
    cnt[i] += 1
    cnt[i + 1] += 1
print((max(cnt)))

-cnt = [0] * (10**7) +cnt = [0] * (10**6)