n = int(eval(input()))

a = [int(i) for i in input().split()]

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

for i in range(n):

    cnt_a[a[i]] += 1

max_cnt = 0

for i in range(1, 10**5 + 1):

    max_cnt = max(max_cnt, sum(cnt_a[i - 1:i + 2]))

print(max_cnt)
n = int(eval(input()))

a = [int(i) for i in input().split()]

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

for i in range(n):

    cnt_x[a[i] - 1] += 1

    cnt_x[a[i]] += 1

    cnt_x[a[i] + 1] += 1

print((max(cnt_x)))
n = int(eval(input()))
a = [int(i) for i in input().split()]
cnt_a = [0] * (10**5 + 2)
for i in range(n):
    cnt_a[a[i]] += 1
max_cnt = 0
for i in range(1, 10**5 + 1):
    max_cnt = max(max_cnt, sum(cnt_a[i - 1 : i + 2]))
print(max_cnt)

n = int(eval(input()))
a = [int(i) for i in input().split()]
cnt_x = [0] * (10**5 + 2)
for i in range(n):
    cnt_x[a[i] - 1] += 1
    cnt_x[a[i]] += 1
    cnt_x[a[i] + 1] += 1
print((max(cnt_x)))

-cnt_a = [0] * (10**5 + 2) +cnt_x = [0] * (10**5 + 2) -    cnt_a[a[i]] += 1 -max_cnt = 0 -for i in range(1, 10**5 + 1): -    max_cnt = max(max_cnt, sum(cnt_a[i - 1 : i + 2])) -print(max_cnt) +    cnt_x[a[i] - 1] += 1 +    cnt_x[a[i]] += 1 +    cnt_x[a[i] + 1] += 1 +print((max(cnt_x)))