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

public class Main {
    //Divide the Problems
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] A = new int[n];
        for (int i = 0; i < n; i++) A[i] = sc.nextInt();
        System.out.println(sln(A));
        sc.close();
    }

    static int sln(int[] A) {
        int n = A.length / 2;
        Arrays.sort(A);
        return A[n] - A[n - 1];
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    //Divide the Problems
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] A = new int[n];
        for (int i = 0; i < n; i++) A[i] = sc.nextInt();
        System.out.println(sln(A));
        sc.close();
    }

    static int sln(int[] A) {
        int n = A.length / 2;
        Arrays.sort(A);
        return A[n] - A[n - 1];
    }
} Main //Divide the Problems
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] A = new int[n];
        for (int i = 0; i < n; i++) A[i] = sc.nextInt();
        System.out.println(sln(A));
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] A = new int[n];
        for (int i = 0; i < n; i++) A[i] = sc.nextInt();
        System.out.println(sln(A));
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] A = new int[n]; A new int[n] n for (int i = 0; i < n; i++) A[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i A[i] = sc.nextInt(); A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc System.out.println(sln(A)) System.out.println System.out System System.out sln(A) sln A sc.close() sc.close sc String[] args args static int sln(int[] A) {
        int n = A.length / 2;
        Arrays.sort(A);
        return A[n] - A[n - 1];
    } sln {
        int n = A.length / 2;
        Arrays.sort(A);
        return A[n] - A[n - 1];
    } int n = A.length / 2; n A.length / 2 A.length A A.length 2 Arrays.sort(A) Arrays.sort Arrays A return A[n] - A[n - 1]; A[n] - A[n - 1] A[n] A n A[n - 1] A n - 1 n 1 int[] A A public class Main {
    //Divide the Problems
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] A = new int[n];
        for (int i = 0; i < n; i++) A[i] = sc.nextInt();
        System.out.println(sln(A));
        sc.close();
    }

    static int sln(int[] A) {
        int n = A.length / 2;
        Arrays.sort(A);
        return A[n] - A[n - 1];
    }
} public class Main {
    //Divide the Problems
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] A = new int[n];
        for (int i = 0; i < n; i++) A[i] = sc.nextInt();
        System.out.println(sln(A));
        sc.close();
    }

    static int sln(int[] A) {
        int n = A.length / 2;
        Arrays.sort(A);
        return A[n] - A[n - 1];
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    //Divide the Problems
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] A = new int[n];
        for (int i = 0; i < n; i++) A[i] = sc.nextInt();
        System.out.println(sln(A));
        sc.close();
    }

    static int sln(int[] A) {
        int n = A.length / 2;
        Arrays.sort(A);
        return A[n] - A[n - 1];
    }
}
