import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        ArrayList<Integer> arrayList = new ArrayList<Integer>();

        for(int i=0; i<n; i++){
            int p = sc.nextInt();
            arrayList.add(p);
        }

        Collections.sort(arrayList);


        int size = arrayList.size();
        int leftHalf = size / 2 - 1;
        int rightHalf = leftHalf + 1;

        if(arrayList.get(leftHalf) == arrayList.get(rightHalf)){
            System.out.println(0);
        }else{
            System.out.println(arrayList.get(rightHalf) - arrayList.get(leftHalf));
        }

    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections 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();

        ArrayList<Integer> arrayList = new ArrayList<Integer>();

        for(int i=0; i<n; i++){
            int p = sc.nextInt();
            arrayList.add(p);
        }

        Collections.sort(arrayList);


        int size = arrayList.size();
        int leftHalf = size / 2 - 1;
        int rightHalf = leftHalf + 1;

        if(arrayList.get(leftHalf) == arrayList.get(rightHalf)){
            System.out.println(0);
        }else{
            System.out.println(arrayList.get(rightHalf) - arrayList.get(leftHalf));
        }

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

        int n = sc.nextInt();

        ArrayList<Integer> arrayList = new ArrayList<Integer>();

        for(int i=0; i<n; i++){
            int p = sc.nextInt();
            arrayList.add(p);
        }

        Collections.sort(arrayList);


        int size = arrayList.size();
        int leftHalf = size / 2 - 1;
        int rightHalf = leftHalf + 1;

        if(arrayList.get(leftHalf) == arrayList.get(rightHalf)){
            System.out.println(0);
        }else{
            System.out.println(arrayList.get(rightHalf) - arrayList.get(leftHalf));
        }

    } main {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        ArrayList<Integer> arrayList = new ArrayList<Integer>();

        for(int i=0; i<n; i++){
            int p = sc.nextInt();
            arrayList.add(p);
        }

        Collections.sort(arrayList);


        int size = arrayList.size();
        int leftHalf = size / 2 - 1;
        int rightHalf = leftHalf + 1;

        if(arrayList.get(leftHalf) == arrayList.get(rightHalf)){
            System.out.println(0);
        }else{
            System.out.println(arrayList.get(rightHalf) - arrayList.get(leftHalf));
        }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc ArrayList<Integer> arrayList = new ArrayList<Integer>(); arrayList new ArrayList<Integer>() for(int i=0; i<n; i++){
            int p = sc.nextInt();
            arrayList.add(p);
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            int p = sc.nextInt();
            arrayList.add(p);
        } {
            int p = sc.nextInt();
            arrayList.add(p);
        } int p = sc.nextInt(); p sc.nextInt() sc.nextInt sc arrayList.add(p) arrayList.add arrayList p Collections.sort(arrayList) Collections.sort Collections arrayList int size = arrayList.size(); size arrayList.size() arrayList.size arrayList int leftHalf = size / 2 - 1; leftHalf size / 2 - 1 size / 2 size 2 1 int rightHalf = leftHalf + 1; rightHalf leftHalf + 1 leftHalf 1 if(arrayList.get(leftHalf) == arrayList.get(rightHalf)){
            System.out.println(0);
        }else{
            System.out.println(arrayList.get(rightHalf) - arrayList.get(leftHalf));
        } arrayList.get(leftHalf) == arrayList.get(rightHalf) arrayList.get(leftHalf) arrayList.get arrayList leftHalf arrayList.get(rightHalf) arrayList.get arrayList rightHalf {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 {
            System.out.println(arrayList.get(rightHalf) - arrayList.get(leftHalf));
        } System.out.println(arrayList.get(rightHalf) - arrayList.get(leftHalf)) System.out.println System.out System System.out arrayList.get(rightHalf) - arrayList.get(leftHalf) arrayList.get(rightHalf) arrayList.get arrayList rightHalf arrayList.get(leftHalf) arrayList.get arrayList leftHalf String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        ArrayList<Integer> arrayList = new ArrayList<Integer>();

        for(int i=0; i<n; i++){
            int p = sc.nextInt();
            arrayList.add(p);
        }

        Collections.sort(arrayList);


        int size = arrayList.size();
        int leftHalf = size / 2 - 1;
        int rightHalf = leftHalf + 1;

        if(arrayList.get(leftHalf) == arrayList.get(rightHalf)){
            System.out.println(0);
        }else{
            System.out.println(arrayList.get(rightHalf) - arrayList.get(leftHalf));
        }

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

        int n = sc.nextInt();

        ArrayList<Integer> arrayList = new ArrayList<Integer>();

        for(int i=0; i<n; i++){
            int p = sc.nextInt();
            arrayList.add(p);
        }

        Collections.sort(arrayList);


        int size = arrayList.size();
        int leftHalf = size / 2 - 1;
        int rightHalf = leftHalf + 1;

        if(arrayList.get(leftHalf) == arrayList.get(rightHalf)){
            System.out.println(0);
        }else{
            System.out.println(arrayList.get(rightHalf) - arrayList.get(leftHalf));
        }

    }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        ArrayList<Integer> arrayList = new ArrayList<Integer>();

        for(int i=0; i<n; i++){
            int p = sc.nextInt();
            arrayList.add(p);
        }

        Collections.sort(arrayList);


        int size = arrayList.size();
        int leftHalf = size / 2 - 1;
        int rightHalf = leftHalf + 1;

        if(arrayList.get(leftHalf) == arrayList.get(rightHalf)){
            System.out.println(0);
        }else{
            System.out.println(arrayList.get(rightHalf) - arrayList.get(leftHalf));
        }

    }
}
