import java.util.ArrayList;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        ArrayList<Integer> scores = new ArrayList<>();
        int n = in.nextInt();
        for (int i = 0; i < n; i++){
            scores.add(in.nextInt());
        }
        scores.sort(Comparator.naturalOrder());
        System.out.println(scores.get(n / 2) - scores.get(n / 2 - 1));
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Comparator; Comparator java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        ArrayList<Integer> scores = new ArrayList<>();
        int n = in.nextInt();
        for (int i = 0; i < n; i++){
            scores.add(in.nextInt());
        }
        scores.sort(Comparator.naturalOrder());
        System.out.println(scores.get(n / 2) - scores.get(n / 2 - 1));
    }
} Main public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        ArrayList<Integer> scores = new ArrayList<>();
        int n = in.nextInt();
        for (int i = 0; i < n; i++){
            scores.add(in.nextInt());
        }
        scores.sort(Comparator.naturalOrder());
        System.out.println(scores.get(n / 2) - scores.get(n / 2 - 1));
    } main {
        Scanner in = new Scanner(System.in);
        ArrayList<Integer> scores = new ArrayList<>();
        int n = in.nextInt();
        for (int i = 0; i < n; i++){
            scores.add(in.nextInt());
        }
        scores.sort(Comparator.naturalOrder());
        System.out.println(scores.get(n / 2) - scores.get(n / 2 - 1));
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) ArrayList<Integer> scores = new ArrayList<>(); scores new ArrayList<>() int n = in.nextInt(); n in.nextInt() in.nextInt in for (int i = 0; i < n; i++){
            scores.add(in.nextInt());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            scores.add(in.nextInt());
        } {
            scores.add(in.nextInt());
        } scores.add(in.nextInt()) scores.add scores in.nextInt() in.nextInt in scores.sort(Comparator.naturalOrder()) scores.sort scores Comparator.naturalOrder() Comparator.naturalOrder Comparator System.out.println(scores.get(n / 2) - scores.get(n / 2 - 1)) System.out.println System.out System System.out scores.get(n / 2) - scores.get(n / 2 - 1) scores.get(n / 2) scores.get scores n / 2 n 2 scores.get(n / 2 - 1) scores.get scores n / 2 - 1 n / 2 n 2 1 String args[] args public class Main {
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        ArrayList<Integer> scores = new ArrayList<>();
        int n = in.nextInt();
        for (int i = 0; i < n; i++){
            scores.add(in.nextInt());
        }
        scores.sort(Comparator.naturalOrder());
        System.out.println(scores.get(n / 2) - scores.get(n / 2 - 1));
    }
} public class Main {
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        ArrayList<Integer> scores = new ArrayList<>();
        int n = in.nextInt();
        for (int i = 0; i < n; i++){
            scores.add(in.nextInt());
        }
        scores.sort(Comparator.naturalOrder());
        System.out.println(scores.get(n / 2) - scores.get(n / 2 - 1));
    }
} Main
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        ArrayList<Integer> scores = new ArrayList<>();
        int n = in.nextInt();
        for (int i = 0; i < n; i++){
            scores.add(in.nextInt());
        }
        scores.sort(Comparator.naturalOrder());
        System.out.println(scores.get(n / 2) - scores.get(n / 2 - 1));
    }
}
