N = int(eval(input()))

D = [int(x) for x in input().split()]

D.sort()



M = N//2



x,y = D[M-1:M+1]

answer = y - x

print(answer)
import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



N,*D = list(map(int,read().split()))



n = N//2

D.sort()

answer = D[n] - D[n-1]

print(answer)
N = int(eval(input()))
D = [int(x) for x in input().split()]
D.sort()
M = N // 2
x, y = D[M - 1 : M + 1]
answer = y - x
print(answer)

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, *D = list(map(int, read().split()))
n = N // 2
D.sort()
answer = D[n] - D[n - 1]
print(answer)

-N = int(eval(input())) -D = [int(x) for x in input().split()] +import sys + +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +N, *D = list(map(int, read().split())) +n = N // 2 -M = N // 2 -x, y = D[M - 1 : M + 1] -answer = y - x +answer = D[n] - D[n - 1]