

import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String args[])
	{
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int ar[]=new int[n];
		for(int i=0;i<n;i++)
		{
			ar[i]=scan.nextInt();
			
		}
		Arrays.sort(ar);
		if(n%2==1)
		{
			System.out.println(0);
		}else {
			int div=(int) Math.ceil(n/2);
			System.out.println(ar[div]-ar[div-1]);
		}
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String args[])
	{
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int ar[]=new int[n];
		for(int i=0;i<n;i++)
		{
			ar[i]=scan.nextInt();
			
		}
		Arrays.sort(ar);
		if(n%2==1)
		{
			System.out.println(0);
		}else {
			int div=(int) Math.ceil(n/2);
			System.out.println(ar[div]-ar[div-1]);
		}
	}
} Main public static void main(String args[])
	{
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int ar[]=new int[n];
		for(int i=0;i<n;i++)
		{
			ar[i]=scan.nextInt();
			
		}
		Arrays.sort(ar);
		if(n%2==1)
		{
			System.out.println(0);
		}else {
			int div=(int) Math.ceil(n/2);
			System.out.println(ar[div]-ar[div-1]);
		}
	} main {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int ar[]=new int[n];
		for(int i=0;i<n;i++)
		{
			ar[i]=scan.nextInt();
			
		}
		Arrays.sort(ar);
		if(n%2==1)
		{
			System.out.println(0);
		}else {
			int div=(int) Math.ceil(n/2);
			System.out.println(ar[div]-ar[div-1]);
		}
	} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int n=scan.nextInt(); n scan.nextInt() scan.nextInt scan int ar[]=new int[n]; ar new int[n] n for(int i=0;i<n;i++)
		{
			ar[i]=scan.nextInt();
			
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			ar[i]=scan.nextInt();
			
		} {
			ar[i]=scan.nextInt();
			
		} ar[i]=scan.nextInt() ar[i] ar i scan.nextInt() scan.nextInt scan Arrays.sort(ar) Arrays.sort Arrays ar if(n%2==1)
		{
			System.out.println(0);
		}else {
			int div=(int) Math.ceil(n/2);
			System.out.println(ar[div]-ar[div-1]);
		} n%2==1 n%2 n 2 1 {
			System.out.println(0);
		} System.out.println(0) System.out.println System.out System System.out 0 {
			int div=(int) Math.ceil(n/2);
			System.out.println(ar[div]-ar[div-1]);
		} int div=(int) Math.ceil(n/2); div (int) Math.ceil(n/2) Math.ceil Math n/2 n 2 System.out.println(ar[div]-ar[div-1]) System.out.println System.out System System.out ar[div]-ar[div-1] ar[div] ar div ar[div-1] ar div-1 div 1 String args[] args public class Main {

	public static void main(String args[])
	{
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int ar[]=new int[n];
		for(int i=0;i<n;i++)
		{
			ar[i]=scan.nextInt();
			
		}
		Arrays.sort(ar);
		if(n%2==1)
		{
			System.out.println(0);
		}else {
			int div=(int) Math.ceil(n/2);
			System.out.println(ar[div]-ar[div-1]);
		}
	}
} public class Main {

	public static void main(String args[])
	{
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int ar[]=new int[n];
		for(int i=0;i<n;i++)
		{
			ar[i]=scan.nextInt();
			
		}
		Arrays.sort(ar);
		if(n%2==1)
		{
			System.out.println(0);
		}else {
			int div=(int) Math.ceil(n/2);
			System.out.println(ar[div]-ar[div-1]);
		}
	}
} Main


import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String args[])
	{
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int ar[]=new int[n];
		for(int i=0;i<n;i++)
		{
			ar[i]=scan.nextInt();
			
		}
		Arrays.sort(ar);
		if(n%2==1)
		{
			System.out.println(0);
		}else {
			int div=(int) Math.ceil(n/2);
			System.out.println(ar[div]-ar[div-1]);
		}
	}
}
