N=int(eval(input()))

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

d.sort()



floor=d[N//2-1]

ceil=d[N//2]



print((ceil-floor))
import sys

input = sys.stdin.readline



def I(): return int(eval(input()))

def MI(): return list(map(int, input().split()))

def LI(): return list(map(int, input().split()))



def main():

    mod=10**9+7

    N=I()

    d=LI()

    d.sort()

    a=d[N//2-1]

    b=d[N//2]

    ans=b-a

    print(ans)



main()

N = int(eval(input()))
d = list(map(int, input().split()))
d.sort()
floor = d[N // 2 - 1]
ceil = d[N // 2]
print((ceil - floor))

import sys

input = sys.stdin.readline


def I():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def LI():
    return list(map(int, input().split()))


def main():
    mod = 10**9 + 7
    N = I()
    d = LI()
    d.sort()
    a = d[N // 2 - 1]
    b = d[N // 2]
    ans = b - a
    print(ans)


main()

-N = int(eval(input())) -d = list(map(int, input().split())) -d.sort() -floor = d[N // 2 - 1] -ceil = d[N // 2] -print((ceil - floor)) +import sys + +input = sys.stdin.readline + + +def I(): +    return int(eval(input())) + + +def MI(): +    return list(map(int, input().split())) + + +def LI(): +    return list(map(int, input().split())) + + +def main(): +    mod = 10**9 + 7 +    N = I() +    d = LI() +    d.sort() +    a = d[N // 2 - 1] +    b = d[N // 2] +    ans = b - a +    print(ans) + + +main()