import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;

public class Main {

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

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

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

	public static void main(String[] args) {
       
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<Integer>();
        for(int i = 0; i < a; i++){
            list.add(sc.nextInt());
        }
        ArrayList<Integer> list1 = new ArrayList<>(list);
        Collections.sort(list1);
        int center1 = list1.size() / 2 - 1;
        int center2 = center1 + 1;
        int ans = list1.get(center2) - list1.get(center1);
        
        System.out.println(ans);
    }
} Main
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;

public class Main {

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