

N = int(eval(input()))

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

d.sort()



print((d[N//2] - d[(N//2) - 1]))
def main():

    N = int(eval(input()))

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

    D.sort()

    print((D[N//2] - D[N//2 - 1]))





if __name__ == '__main__':

    main()

N = int(eval(input()))
d = [int(i) for i in input().split()]
d.sort()
print((d[N // 2] - d[(N // 2) - 1]))

def main():
    N = int(eval(input()))
    D = [int(i) for i in input().split()]
    D.sort()
    print((D[N // 2] - D[N // 2 - 1]))


if __name__ == "__main__":
    main()

-N = int(eval(input())) -d = [int(i) for i in input().split()] -d.sort() -print((d[N // 2] - d[(N // 2) - 1])) +def main(): +    N = int(eval(input())) +    D = [int(i) for i in input().split()] +    D.sort() +    print((D[N // 2] - D[N // 2 - 1])) + + +if __name__ == "__main__": +    main()