n=int(eval(input()))

m,M=[],[]

for i in range(n):

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

  m+=[a]

  M+=[b]

m.sort()

M.sort()

d=n//2

print((M[d]-m[d]+1+(M[d-1]+-m[d-1])*(1-n%2)))
n,*l=list(map(int,open(0).read().split()))

m,M=sorted(l[::2]),sorted(l[1::2])

d=n//2

print((M[d]-m[d]+1+(M[d-1]+-m[d-1])*(n%2^1)))
n = int(eval(input()))
m, M = [], []
for i in range(n):
    a, b = list(map(int, input().split()))
    m += [a]
    M += [b]
m.sort()
M.sort()
d = n // 2
print((M[d] - m[d] + 1 + (M[d - 1] + -m[d - 1]) * (1 - n % 2)))

n, *l = list(map(int, open(0).read().split()))
m, M = sorted(l[::2]), sorted(l[1::2])
d = n // 2
print((M[d] - m[d] + 1 + (M[d - 1] + -m[d - 1]) * (n % 2 ^ 1)))

-n = int(eval(input())) -m, M = [], [] -for i in range(n): -    a, b = list(map(int, input().split())) -    m += [a] -    M += [b] -m.sort() -M.sort() +n, *l = list(map(int, open(0).read().split())) +m, M = sorted(l[::2]), sorted(l[1::2]) -print((M[d] - m[d] + 1 + (M[d - 1] + -m[d - 1]) * (1 - n % 2))) +print((M[d] - m[d] + 1 + (M[d - 1] + -m[d - 1]) * (n % 2 ^ 1)))