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

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = scanner.nextInt();
        }
        Arrays.sort(array);
//        for (int i = 0; i < n; i++) {
////            System.out.print(array[i] + " ");
////        }

        System.out.println("\n" + (array[n/2] - array[n/2-1]));

    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = scanner.nextInt();
        }
        Arrays.sort(array);
//        for (int i = 0; i < n; i++) {
////            System.out.print(array[i] + " ");
////        }

        System.out.println("\n" + (array[n/2] - array[n/2-1]));

    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = scanner.nextInt();
        }
        Arrays.sort(array);
//        for (int i = 0; i < n; i++) {
////            System.out.print(array[i] + " ");
////        }

        System.out.println("\n" + (array[n/2] - array[n/2-1]));

    } main {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = scanner.nextInt();
        }
        Arrays.sort(array);
//        for (int i = 0; i < n; i++) {
////            System.out.print(array[i] + " ");
////        }

        System.out.println("\n" + (array[n/2] - array[n/2-1]));

    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int[] array = new int[n]; array new int[n] n for (int i = 0; i < n; i++) {
            array[i] = scanner.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            array[i] = scanner.nextInt();
        } {
            array[i] = scanner.nextInt();
        } array[i] = scanner.nextInt() array[i] array i scanner.nextInt() scanner.nextInt scanner Arrays.sort(array) Arrays.sort Arrays array System.out.println("\n" + (array[n/2] - array[n/2-1])) System.out.println System.out System System.out "\n" + (array[n/2] - array[n/2-1]) "\n" (array[n/2] - array[n/2-1]) array[n/2] array n/2 n 2 array[n/2-1] array n/2-1 n/2 n 2 1 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = scanner.nextInt();
        }
        Arrays.sort(array);
//        for (int i = 0; i < n; i++) {
////            System.out.print(array[i] + " ");
////        }

        System.out.println("\n" + (array[n/2] - array[n/2-1]));

    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = scanner.nextInt();
        }
        Arrays.sort(array);
//        for (int i = 0; i < n; i++) {
////            System.out.print(array[i] + " ");
////        }

        System.out.println("\n" + (array[n/2] - array[n/2-1]));

    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = scanner.nextInt();
        }
        Arrays.sort(array);
//        for (int i = 0; i < n; i++) {
////            System.out.print(array[i] + " ");
////        }

        System.out.println("\n" + (array[n/2] - array[n/2-1]));

    }
}
