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

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] dlist = new int[N];

        for (int i = 0; i < N; i++) {
            dlist[i] = sc.nextInt();
        }

        Arrays.sort(dlist);
        int cntpp = N / 2;
        int cntpm = N / 2 - 1;

        if (dlist[cntpm] == dlist[cntpp]) {
            System.out.println(0);
        } else {
            System.out.println(dlist[cntpp] - dlist[cntpm]);
        }

    }
} import java.util.Arrays; Arrays 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 = sc.nextInt();
        int[] dlist = new int[N];

        for (int i = 0; i < N; i++) {
            dlist[i] = sc.nextInt();
        }

        Arrays.sort(dlist);
        int cntpp = N / 2;
        int cntpm = N / 2 - 1;

        if (dlist[cntpm] == dlist[cntpp]) {
            System.out.println(0);
        } else {
            System.out.println(dlist[cntpp] - dlist[cntpm]);
        }

    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] dlist = new int[N];

        for (int i = 0; i < N; i++) {
            dlist[i] = sc.nextInt();
        }

        Arrays.sort(dlist);
        int cntpp = N / 2;
        int cntpm = N / 2 - 1;

        if (dlist[cntpm] == dlist[cntpp]) {
            System.out.println(0);
        } else {
            System.out.println(dlist[cntpp] - dlist[cntpm]);
        }

    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] dlist = new int[N];

        for (int i = 0; i < N; i++) {
            dlist[i] = sc.nextInt();
        }

        Arrays.sort(dlist);
        int cntpp = N / 2;
        int cntpm = N / 2 - 1;

        if (dlist[cntpm] == dlist[cntpp]) {
            System.out.println(0);
        } else {
            System.out.println(dlist[cntpp] - dlist[cntpm]);
        }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] dlist = new int[N]; dlist new int[N] N for (int i = 0; i < N; i++) {
            dlist[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            dlist[i] = sc.nextInt();
        } {
            dlist[i] = sc.nextInt();
        } dlist[i] = sc.nextInt() dlist[i] dlist i sc.nextInt() sc.nextInt sc Arrays.sort(dlist) Arrays.sort Arrays dlist int cntpp = N / 2; cntpp N / 2 N 2 int cntpm = N / 2 - 1; cntpm N / 2 - 1 N / 2 N 2 1 if (dlist[cntpm] == dlist[cntpp]) {
            System.out.println(0);
        } else {
            System.out.println(dlist[cntpp] - dlist[cntpm]);
        } dlist[cntpm] == dlist[cntpp] dlist[cntpm] dlist cntpm dlist[cntpp] dlist cntpp {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 {
            System.out.println(dlist[cntpp] - dlist[cntpm]);
        } System.out.println(dlist[cntpp] - dlist[cntpm]) System.out.println System.out System System.out dlist[cntpp] - dlist[cntpm] dlist[cntpp] dlist cntpp dlist[cntpm] dlist cntpm String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] dlist = new int[N];

        for (int i = 0; i < N; i++) {
            dlist[i] = sc.nextInt();
        }

        Arrays.sort(dlist);
        int cntpp = N / 2;
        int cntpm = N / 2 - 1;

        if (dlist[cntpm] == dlist[cntpp]) {
            System.out.println(0);
        } else {
            System.out.println(dlist[cntpp] - dlist[cntpm]);
        }

    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] dlist = new int[N];

        for (int i = 0; i < N; i++) {
            dlist[i] = sc.nextInt();
        }

        Arrays.sort(dlist);
        int cntpp = N / 2;
        int cntpm = N / 2 - 1;

        if (dlist[cntpm] == dlist[cntpp]) {
            System.out.println(0);
        } else {
            System.out.println(dlist[cntpp] - dlist[cntpm]);
        }

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

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] dlist = new int[N];

        for (int i = 0; i < N; i++) {
            dlist[i] = sc.nextInt();
        }

        Arrays.sort(dlist);
        int cntpp = N / 2;
        int cntpm = N / 2 - 1;

        if (dlist[cntpm] == dlist[cntpp]) {
            System.out.println(0);
        } else {
            System.out.println(dlist[cntpp] - dlist[cntpm]);
        }

    }
}
