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

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer a = Integer.parseInt(scanner.next());

        Integer[] d =  new Integer[a];

        for(int i = 0; i < a; i++) {
            d[i] = Integer.parseInt(scanner.next());
        }
        Arrays.sort(d);

        int half = d.length / 2;
        int start = d[half-1];
        int end = 0;

        if(!(start == d[half])) {
            end = d[half];
            System.out.println(Math.abs(start-end));
        } else {
            System.out.println(0);
        }

    }
} 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);
        Integer a = Integer.parseInt(scanner.next());

        Integer[] d =  new Integer[a];

        for(int i = 0; i < a; i++) {
            d[i] = Integer.parseInt(scanner.next());
        }
        Arrays.sort(d);

        int half = d.length / 2;
        int start = d[half-1];
        int end = 0;

        if(!(start == d[half])) {
            end = d[half];
            System.out.println(Math.abs(start-end));
        } else {
            System.out.println(0);
        }

    }
} Main public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer a = Integer.parseInt(scanner.next());

        Integer[] d =  new Integer[a];

        for(int i = 0; i < a; i++) {
            d[i] = Integer.parseInt(scanner.next());
        }
        Arrays.sort(d);

        int half = d.length / 2;
        int start = d[half-1];
        int end = 0;

        if(!(start == d[half])) {
            end = d[half];
            System.out.println(Math.abs(start-end));
        } else {
            System.out.println(0);
        }

    } main {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer a = Integer.parseInt(scanner.next());

        Integer[] d =  new Integer[a];

        for(int i = 0; i < a; i++) {
            d[i] = Integer.parseInt(scanner.next());
        }
        Arrays.sort(d);

        int half = d.length / 2;
        int start = d[half-1];
        int end = 0;

        if(!(start == d[half])) {
            end = d[half];
            System.out.println(Math.abs(start-end));
        } else {
            System.out.println(0);
        }

    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) Integer a = Integer.parseInt(scanner.next()); a Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner Integer[] d =  new Integer[a]; d new Integer[a] a for(int i = 0; i < a; i++) {
            d[i] = Integer.parseInt(scanner.next());
        } int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
            d[i] = Integer.parseInt(scanner.next());
        } {
            d[i] = Integer.parseInt(scanner.next());
        } d[i] = Integer.parseInt(scanner.next()) d[i] d i Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner Arrays.sort(d) Arrays.sort Arrays d int half = d.length / 2; half d.length / 2 d.length d d.length 2 int start = d[half-1]; start d[half-1] d half-1 half 1 int end = 0; end 0 if(!(start == d[half])) {
            end = d[half];
            System.out.println(Math.abs(start-end));
        } else {
            System.out.println(0);
        } !(start == d[half]) (start == d[half]) start d[half] d half {
            end = d[half];
            System.out.println(Math.abs(start-end));
        } end = d[half] end d[half] d half System.out.println(Math.abs(start-end)) System.out.println System.out System System.out Math.abs(start-end) Math.abs Math start-end start end {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 String[] args args public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer a = Integer.parseInt(scanner.next());

        Integer[] d =  new Integer[a];

        for(int i = 0; i < a; i++) {
            d[i] = Integer.parseInt(scanner.next());
        }
        Arrays.sort(d);

        int half = d.length / 2;
        int start = d[half-1];
        int end = 0;

        if(!(start == d[half])) {
            end = d[half];
            System.out.println(Math.abs(start-end));
        } else {
            System.out.println(0);
        }

    }
} public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer a = Integer.parseInt(scanner.next());

        Integer[] d =  new Integer[a];

        for(int i = 0; i < a; i++) {
            d[i] = Integer.parseInt(scanner.next());
        }
        Arrays.sort(d);

        int half = d.length / 2;
        int start = d[half-1];
        int end = 0;

        if(!(start == d[half])) {
            end = d[half];
            System.out.println(Math.abs(start-end));
        } else {
            System.out.println(0);
        }

    }
} Main

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

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer a = Integer.parseInt(scanner.next());

        Integer[] d =  new Integer[a];

        for(int i = 0; i < a; i++) {
            d[i] = Integer.parseInt(scanner.next());
        }
        Arrays.sort(d);

        int half = d.length / 2;
        int start = d[half-1];
        int end = 0;

        if(!(start == d[half])) {
            end = d[half];
            System.out.println(Math.abs(start-end));
        } else {
            System.out.println(0);
        }

    }
}
