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

public class Main {
    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int length = scanner.nextInt();
        final int[] difficulties = new int[length];

        for (int i = 0; i < length; i++) {
            difficulties[i] = scanner.nextInt();
        }

        Arrays.sort(difficulties);

        final int half = length / 2;
        System.out.println(difficulties[half] - difficulties[half - 1]);
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int length = scanner.nextInt();
        final int[] difficulties = new int[length];

        for (int i = 0; i < length; i++) {
            difficulties[i] = scanner.nextInt();
        }

        Arrays.sort(difficulties);

        final int half = length / 2;
        System.out.println(difficulties[half] - difficulties[half - 1]);
    }
} Main public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int length = scanner.nextInt();
        final int[] difficulties = new int[length];

        for (int i = 0; i < length; i++) {
            difficulties[i] = scanner.nextInt();
        }

        Arrays.sort(difficulties);

        final int half = length / 2;
        System.out.println(difficulties[half] - difficulties[half - 1]);
    } main {
        final Scanner scanner = new Scanner(System.in);
        final int length = scanner.nextInt();
        final int[] difficulties = new int[length];

        for (int i = 0; i < length; i++) {
            difficulties[i] = scanner.nextInt();
        }

        Arrays.sort(difficulties);

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

        for (int i = 0; i < length; i++) {
            difficulties[i] = scanner.nextInt();
        }

        Arrays.sort(difficulties);

        final int half = length / 2;
        System.out.println(difficulties[half] - difficulties[half - 1]);
    }
} public class Main {
    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int length = scanner.nextInt();
        final int[] difficulties = new int[length];

        for (int i = 0; i < length; i++) {
            difficulties[i] = scanner.nextInt();
        }

        Arrays.sort(difficulties);

        final int half = length / 2;
        System.out.println(difficulties[half] - difficulties[half - 1]);
    }
} Main

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

public class Main {
    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int length = scanner.nextInt();
        final int[] difficulties = new int[length];

        for (int i = 0; i < length; i++) {
            difficulties[i] = scanner.nextInt();
        }

        Arrays.sort(difficulties);

        final int half = length / 2;
        System.out.println(difficulties[half] - difficulties[half - 1]);
    }
}
