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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        List<Integer> nums = new ArrayList<>();
        for(int i = 0;i < n;i++) {
            nums.add(sc.nextInt());
        }
        Collections.sort(nums);
        int n1 = nums.get(n / 2 - 1);
        int n2 = nums.get(n / 2);
        System.out.println(n2 - n1);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        List<Integer> nums = new ArrayList<>();
        for(int i = 0;i < n;i++) {
            nums.add(sc.nextInt());
        }
        Collections.sort(nums);
        int n1 = nums.get(n / 2 - 1);
        int n2 = nums.get(n / 2);
        System.out.println(n2 - n1);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        List<Integer> nums = new ArrayList<>();
        for(int i = 0;i < n;i++) {
            nums.add(sc.nextInt());
        }
        Collections.sort(nums);
        int n1 = nums.get(n / 2 - 1);
        int n2 = nums.get(n / 2);
        System.out.println(n2 - n1);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        List<Integer> nums = new ArrayList<>();
        for(int i = 0;i < n;i++) {
            nums.add(sc.nextInt());
        }
        Collections.sort(nums);
        int n1 = nums.get(n / 2 - 1);
        int n2 = nums.get(n / 2);
        System.out.println(n2 - n1);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.nextLine()); n Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc List<Integer> nums = new ArrayList<>(); nums new ArrayList<>() for(int i = 0;i < n;i++) {
            nums.add(sc.nextInt());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            nums.add(sc.nextInt());
        } {
            nums.add(sc.nextInt());
        } nums.add(sc.nextInt()) nums.add nums sc.nextInt() sc.nextInt sc Collections.sort(nums) Collections.sort Collections nums int n1 = nums.get(n / 2 - 1); n1 nums.get(n / 2 - 1) nums.get nums n / 2 - 1 n / 2 n 2 1 int n2 = nums.get(n / 2); n2 nums.get(n / 2) nums.get nums n / 2 n 2 System.out.println(n2 - n1) System.out.println System.out System System.out n2 - n1 n2 n1 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        List<Integer> nums = new ArrayList<>();
        for(int i = 0;i < n;i++) {
            nums.add(sc.nextInt());
        }
        Collections.sort(nums);
        int n1 = nums.get(n / 2 - 1);
        int n2 = nums.get(n / 2);
        System.out.println(n2 - n1);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        List<Integer> nums = new ArrayList<>();
        for(int i = 0;i < n;i++) {
            nums.add(sc.nextInt());
        }
        Collections.sort(nums);
        int n1 = nums.get(n / 2 - 1);
        int n2 = nums.get(n / 2);
        System.out.println(n2 - n1);
    }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        List<Integer> nums = new ArrayList<>();
        for(int i = 0;i < n;i++) {
            nums.add(sc.nextInt());
        }
        Collections.sort(nums);
        int n1 = nums.get(n / 2 - 1);
        int n2 = nums.get(n / 2);
        System.out.println(n2 - n1);
    }
}