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

public class Main{
	public static void main(String[]args){
    	Scanner sc=new Scanner(System.in);
      	int N=sc.nextInt();
      	int array[]=new int[N];

      	for(int t=0;t<N;t++){
        	array[t]=sc.nextInt();
        }

      	Arrays.sort(array);
				int big=N/2;
				int small=N/2-1;

				

				System.out.println(array[big]-array[small]);
}
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main{
	public static void main(String[]args){
    	Scanner sc=new Scanner(System.in);
      	int N=sc.nextInt();
      	int array[]=new int[N];

      	for(int t=0;t<N;t++){
        	array[t]=sc.nextInt();
        }

      	Arrays.sort(array);
				int big=N/2;
				int small=N/2-1;

				

				System.out.println(array[big]-array[small]);
}
} Main public static void main(String[]args){
    	Scanner sc=new Scanner(System.in);
      	int N=sc.nextInt();
      	int array[]=new int[N];

      	for(int t=0;t<N;t++){
        	array[t]=sc.nextInt();
        }

      	Arrays.sort(array);
				int big=N/2;
				int small=N/2-1;

				

				System.out.println(array[big]-array[small]);
} main {
    	Scanner sc=new Scanner(System.in);
      	int N=sc.nextInt();
      	int array[]=new int[N];

      	for(int t=0;t<N;t++){
        	array[t]=sc.nextInt();
        }

      	Arrays.sort(array);
				int big=N/2;
				int small=N/2-1;

				

				System.out.println(array[big]-array[small]);
} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int N=sc.nextInt(); N sc.nextInt() sc.nextInt sc int array[]=new int[N]; array new int[N] N for(int t=0;t<N;t++){
        	array[t]=sc.nextInt();
        } int t=0; int t=0; t 0 t<N t N t++ t++ t {
        	array[t]=sc.nextInt();
        } {
        	array[t]=sc.nextInt();
        } array[t]=sc.nextInt() array[t] array t sc.nextInt() sc.nextInt sc Arrays.sort(array) Arrays.sort Arrays array int big=N/2; big N/2 N 2 int small=N/2-1; small N/2-1 N/2 N 2 1 System.out.println(array[big]-array[small]) System.out.println System.out System System.out array[big]-array[small] array[big] array big array[small] array small String[]args args public class Main{
	public static void main(String[]args){
    	Scanner sc=new Scanner(System.in);
      	int N=sc.nextInt();
      	int array[]=new int[N];

      	for(int t=0;t<N;t++){
        	array[t]=sc.nextInt();
        }

      	Arrays.sort(array);
				int big=N/2;
				int small=N/2-1;

				

				System.out.println(array[big]-array[small]);
}
} public class Main{
	public static void main(String[]args){
    	Scanner sc=new Scanner(System.in);
      	int N=sc.nextInt();
      	int array[]=new int[N];

      	for(int t=0;t<N;t++){
        	array[t]=sc.nextInt();
        }

      	Arrays.sort(array);
				int big=N/2;
				int small=N/2-1;

				

				System.out.println(array[big]-array[small]);
}
} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main{
	public static void main(String[]args){
    	Scanner sc=new Scanner(System.in);
      	int N=sc.nextInt();
      	int array[]=new int[N];

      	for(int t=0;t<N;t++){
        	array[t]=sc.nextInt();
        }

      	Arrays.sort(array);
				int big=N/2;
				int small=N/2-1;

				

				System.out.println(array[big]-array[small]);
}
}
