program main
 implicit none
 integer*8 N,K,i,ans,one
 integer*8, allocatable::d(:)
 data one /1D0/
 read(*,*) N
 allocate( d(1:N) )
 read(*,*) d
 if(mod(N,2) /= 0) then
  write(*,*) 0
 else
  call quicksort(d,one,N) 
  K = N / 2
  ans = d(K+1) - d(K)
  if(K+1 <= N) then
   if(d(K) == d(K+1)) then
    ans = 0
   end if
  end if
  write(*,*) ans
 end if
contains
 recursive subroutine quicksort(a, first, last)
  implicit none
  integer*8  a(*)
  integer*8 first, last, i, j, x, t
  
  x = a( (first+last) / 2 )
  i = first
  j = last
  do
     do while (a(i) < x)
        i=i+1
     end do
     do while (x < a(j))
        j=j-1
     end do
     if (i >= j) exit
     t = a(i);  a(i) = a(j);  a(j) = t
     i=i+1
     j=j-1
  end do
  if (first < i - 1) call quicksort(a, first, i - 1)
  if (j + 1 < last)  call quicksort(a, j + 1, last)
 end subroutine quicksort
end program main
   