
import java.util.*;
import java.math.*;
public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		
        List<Integer> a = new ArrayList<>();
        for (int i = 0; i < K; i++) {
            int d = sc.nextInt();
			a.add(d);
		}
		Collections.sort(a);	
		int half = a.size()/2;

		System.out.println(a.get(half)-a.get(half-1));
   
        }
		
	} import java.util.*; util.* java import java.math.*; math.* java public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		
        List<Integer> a = new ArrayList<>();
        for (int i = 0; i < K; i++) {
            int d = sc.nextInt();
			a.add(d);
		}
		Collections.sort(a);	
		int half = a.size()/2;

		System.out.println(a.get(half)-a.get(half-1));
   
        }
		
	} Main public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		
        List<Integer> a = new ArrayList<>();
        for (int i = 0; i < K; i++) {
            int d = sc.nextInt();
			a.add(d);
		}
		Collections.sort(a);	
		int half = a.size()/2;

		System.out.println(a.get(half)-a.get(half-1));
   
        } main {
		
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		
        List<Integer> a = new ArrayList<>();
        for (int i = 0; i < K; i++) {
            int d = sc.nextInt();
			a.add(d);
		}
		Collections.sort(a);	
		int half = a.size()/2;

		System.out.println(a.get(half)-a.get(half-1));
   
        } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc List<Integer> a = new ArrayList<>(); a new ArrayList<>() for (int i = 0; i < K; i++) {
            int d = sc.nextInt();
			a.add(d);
		} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
            int d = sc.nextInt();
			a.add(d);
		} {
            int d = sc.nextInt();
			a.add(d);
		} int d = sc.nextInt(); d sc.nextInt() sc.nextInt sc a.add(d) a.add a d Collections.sort(a) Collections.sort Collections a int half = a.size()/2; half a.size()/2 a.size() a.size a 2 System.out.println(a.get(half)-a.get(half-1)) System.out.println System.out System System.out a.get(half)-a.get(half-1) a.get(half) a.get a half a.get(half-1) a.get a half-1 half 1 String[] args args public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		
        List<Integer> a = new ArrayList<>();
        for (int i = 0; i < K; i++) {
            int d = sc.nextInt();
			a.add(d);
		}
		Collections.sort(a);	
		int half = a.size()/2;

		System.out.println(a.get(half)-a.get(half-1));
   
        }
		
	} public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		
        List<Integer> a = new ArrayList<>();
        for (int i = 0; i < K; i++) {
            int d = sc.nextInt();
			a.add(d);
		}
		Collections.sort(a);	
		int half = a.size()/2;

		System.out.println(a.get(half)-a.get(half-1));
   
        }
		
	} Main

import java.util.*;
import java.math.*;
public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		
        List<Integer> a = new ArrayList<>();
        for (int i = 0; i < K; i++) {
            int d = sc.nextInt();
			a.add(d);
		}
		Collections.sort(a);	
		int half = a.size()/2;

		System.out.println(a.get(half)-a.get(half-1));
   
        }
		
	}