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[] d = new int[n];

        for (int i = 0; i < n; i++) {
            d[i] = scanner.nextInt();
        }
        Arrays.sort(d);

        if(d[d.length/2 - 1] == d[d.length/2]){
            System.out.println(0);
        } else {
            System.out.println(d[d.length/2] - d[d.length/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[] d = new int[n];

        for (int i = 0; i < n; i++) {
            d[i] = scanner.nextInt();
        }
        Arrays.sort(d);

        if(d[d.length/2 - 1] == d[d.length/2]){
            System.out.println(0);
        } else {
            System.out.println(d[d.length/2] - d[d.length/2 - 1]);
        }
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] d = new int[n];

        for (int i = 0; i < n; i++) {
            d[i] = scanner.nextInt();
        }
        Arrays.sort(d);

        if(d[d.length/2 - 1] == d[d.length/2]){
            System.out.println(0);
        } else {
            System.out.println(d[d.length/2] - d[d.length/2 - 1]);
        }
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] d = new int[n];

        for (int i = 0; i < n; i++) {
            d[i] = scanner.nextInt();
        }
        Arrays.sort(d);

        if(d[d.length/2 - 1] == d[d.length/2]){
            System.out.println(0);
        } else {
            System.out.println(d[d.length/2] - d[d.length/2 - 1]);
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int[] d = new int[n]; d new int[n] n for (int i = 0; i < n; i++) {
            d[i] = scanner.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            d[i] = scanner.nextInt();
        } {
            d[i] = scanner.nextInt();
        } d[i] = scanner.nextInt() d[i] d i scanner.nextInt() scanner.nextInt scanner Arrays.sort(d) Arrays.sort Arrays d if(d[d.length/2 - 1] == d[d.length/2]){
            System.out.println(0);
        } else {
            System.out.println(d[d.length/2] - d[d.length/2 - 1]);
        } d[d.length/2 - 1] == d[d.length/2] d[d.length/2 - 1] d d.length/2 - 1 d.length/2 d.length d d.length 2 1 d[d.length/2] d d.length/2 d.length d d.length 2 {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 {
            System.out.println(d[d.length/2] - d[d.length/2 - 1]);
        } System.out.println(d[d.length/2] - d[d.length/2 - 1]) System.out.println System.out System System.out d[d.length/2] - d[d.length/2 - 1] d[d.length/2] d d.length/2 d.length d d.length 2 d[d.length/2 - 1] d d.length/2 - 1 d.length/2 d.length d d.length 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[] d = new int[n];

        for (int i = 0; i < n; i++) {
            d[i] = scanner.nextInt();
        }
        Arrays.sort(d);

        if(d[d.length/2 - 1] == d[d.length/2]){
            System.out.println(0);
        } else {
            System.out.println(d[d.length/2] - d[d.length/2 - 1]);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] d = new int[n];

        for (int i = 0; i < n; i++) {
            d[i] = scanner.nextInt();
        }
        Arrays.sort(d);

        if(d[d.length/2 - 1] == d[d.length/2]){
            System.out.println(0);
        } else {
            System.out.println(d[d.length/2] - d[d.length/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[] d = new int[n];

        for (int i = 0; i < n; i++) {
            d[i] = scanner.nextInt();
        }
        Arrays.sort(d);

        if(d[d.length/2 - 1] == d[d.length/2]){
            System.out.println(0);
        } else {
            System.out.println(d[d.length/2] - d[d.length/2 - 1]);
        }
    }
}
