import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
    public static int divide(int n, int[] p)
    {
        if(n%2 != 0)
		{
		    return 0;
		}
		else
		{  
		    int output = 0;
		    Arrays.sort(p);
		    int mid = n/2;
		    //if(p[mid] != p[mid-1])
		    //{
		        output = p[mid-1]-p[mid];
		    //}
		    //else if(p[mid] == p[mid-1])
		    //{
		        
		    //}
		    return output;
		}
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] p = new int[n];
		for(int i=0; i<n;i++)
		{
		    p[i] = sc.nextInt();
		}
		int output = divide(n,p);
		if(output < 0)
      	    System.out.println((-1)*output);
      	else
      	    System.out.println(output);
	}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java class Main
{
    public static int divide(int n, int[] p)
    {
        if(n%2 != 0)
		{
		    return 0;
		}
		else
		{  
		    int output = 0;
		    Arrays.sort(p);
		    int mid = n/2;
		    //if(p[mid] != p[mid-1])
		    //{
		        output = p[mid-1]-p[mid];
		    //}
		    //else if(p[mid] == p[mid-1])
		    //{
		        
		    //}
		    return output;
		}
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] p = new int[n];
		for(int i=0; i<n;i++)
		{
		    p[i] = sc.nextInt();
		}
		int output = divide(n,p);
		if(output < 0)
      	    System.out.println((-1)*output);
      	else
      	    System.out.println(output);
	}
} Main public static int divide(int n, int[] p)
    {
        if(n%2 != 0)
		{
		    return 0;
		}
		else
		{  
		    int output = 0;
		    Arrays.sort(p);
		    int mid = n/2;
		    //if(p[mid] != p[mid-1])
		    //{
		        output = p[mid-1]-p[mid];
		    //}
		    //else if(p[mid] == p[mid-1])
		    //{
		        
		    //}
		    return output;
		}
    } divide {
        if(n%2 != 0)
		{
		    return 0;
		}
		else
		{  
		    int output = 0;
		    Arrays.sort(p);
		    int mid = n/2;
		    //if(p[mid] != p[mid-1])
		    //{
		        output = p[mid-1]-p[mid];
		    //}
		    //else if(p[mid] == p[mid-1])
		    //{
		        
		    //}
		    return output;
		}
    } if(n%2 != 0)
		{
		    return 0;
		}
		else
		{  
		    int output = 0;
		    Arrays.sort(p);
		    int mid = n/2;
		    //if(p[mid] != p[mid-1])
		    //{
		        output = p[mid-1]-p[mid];
		    //}
		    //else if(p[mid] == p[mid-1])
		    //{
		        
		    //}
		    return output;
		} n%2 != 0 n%2 n 2 0 {
		    return 0;
		} return 0; 0 {  
		    int output = 0;
		    Arrays.sort(p);
		    int mid = n/2;
		    //if(p[mid] != p[mid-1])
		    //{
		        output = p[mid-1]-p[mid];
		    //}
		    //else if(p[mid] == p[mid-1])
		    //{
		        
		    //}
		    return output;
		} int output = 0; output 0 Arrays.sort(p) Arrays.sort Arrays p int mid = n/2; mid n/2 n 2 output = p[mid-1]-p[mid] output p[mid-1]-p[mid] p[mid-1] p mid-1 mid 1 p[mid] p mid return output; output int n n int[] p p public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] p = new int[n];
		for(int i=0; i<n;i++)
		{
		    p[i] = sc.nextInt();
		}
		int output = divide(n,p);
		if(output < 0)
      	    System.out.println((-1)*output);
      	else
      	    System.out.println(output);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] p = new int[n];
		for(int i=0; i<n;i++)
		{
		    p[i] = sc.nextInt();
		}
		int output = divide(n,p);
		if(output < 0)
      	    System.out.println((-1)*output);
      	else
      	    System.out.println(output);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] p = new int[n]; p new int[n] n for(int i=0; i<n;i++)
		{
		    p[i] = sc.nextInt();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
		    p[i] = sc.nextInt();
		} {
		    p[i] = sc.nextInt();
		} p[i] = sc.nextInt() p[i] p i sc.nextInt() sc.nextInt sc int output = divide(n,p); output divide(n,p) divide n p if(output < 0)
      	    System.out.println((-1)*output);
      	else
      	    System.out.println(output); output < 0 output 0 System.out.println((-1)*output) System.out.println System.out System System.out (-1)*output (-1) 1 output System.out.println(output) System.out.println System.out System System.out output String[] args args
import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
    public static int divide(int n, int[] p)
    {
        if(n%2 != 0)
		{
		    return 0;
		}
		else
		{  
		    int output = 0;
		    Arrays.sort(p);
		    int mid = n/2;
		    //if(p[mid] != p[mid-1])
		    //{
		        output = p[mid-1]-p[mid];
		    //}
		    //else if(p[mid] == p[mid-1])
		    //{
		        
		    //}
		    return output;
		}
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] p = new int[n];
		for(int i=0; i<n;i++)
		{
		    p[i] = sc.nextInt();
		}
		int output = divide(n,p);
		if(output < 0)
      	    System.out.println((-1)*output);
      	else
      	    System.out.println(output);
	}
}