N = int(eval(input()))

X = [list(map(int,input().split())) for _ in range(N)]

A = sorted([X[i][0] for i in range(N)])

B = sorted([X[i][1] for i in range(N)])

if N%2==1:

    k = (N+1)//2

    a = A[k-1]

    b = B[k-1]

    print((b-a+1))

else:

    a2 = A[N//2-1]+A[N//2]

    b2 = B[N//2-1]+B[N//2]

    print((b2-a2+1))
N = int(eval(input()))

X = [list(map(int,input().split())) for _ in range(N)]

A = sorted([X[i][0] for i in range(N)])

B = sorted([X[i][1] for i in range(N)])

if N%2==1:

    a = A[N//2]

    b = B[N//2]

    print((b-a+1))

else:

    a = (A[(N-1)//2]+A[N//2])/2

    b = (B[(N-1)//2]+B[N//2])/2

    print((int((b-a)/0.5)+1))

N = int(eval(input()))
X = [list(map(int, input().split())) for _ in range(N)]
A = sorted([X[i][0] for i in range(N)])
B = sorted([X[i][1] for i in range(N)])
if N % 2 == 1:
    k = (N + 1) // 2
    a = A[k - 1]
    b = B[k - 1]
    print((b - a + 1))
else:
    a2 = A[N // 2 - 1] + A[N // 2]
    b2 = B[N // 2 - 1] + B[N // 2]
    print((b2 - a2 + 1))

N = int(eval(input()))
X = [list(map(int, input().split())) for _ in range(N)]
A = sorted([X[i][0] for i in range(N)])
B = sorted([X[i][1] for i in range(N)])
if N % 2 == 1:
    a = A[N // 2]
    b = B[N // 2]
    print((b - a + 1))
else:
    a = (A[(N - 1) // 2] + A[N // 2]) / 2
    b = (B[(N - 1) // 2] + B[N // 2]) / 2
    print((int((b - a) / 0.5) + 1))

-    k = (N + 1) // 2 -    a = A[k - 1] -    b = B[k - 1] +    a = A[N // 2] +    b = B[N // 2] -    a2 = A[N // 2 - 1] + A[N // 2] -    b2 = B[N // 2 - 1] + B[N // 2] -    print((b2 - a2 + 1)) +    a = (A[(N - 1) // 2] + A[N // 2]) / 2 +    b = (B[(N - 1) // 2] + B[N // 2]) / 2 +    print((int((b - a) / 0.5) + 1))