import java.util.ArrayList;
import java.util.Arrays;
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 = Integer.parseInt(sc.next());
        ArrayList<Integer> l = new ArrayList<>();
        for(int i =0; i < N ;i++){
            l.add(Integer.parseInt(sc.next()));
        }
        Collections.sort(l);
        if(l.get(l.size()/2) == l.get(l.size()/2-1)){
            System.out.println(0);
        }else{
            System.out.println(l.get(l.size()/2)-l.get(l.size()/2-1));
        }
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays 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 = Integer.parseInt(sc.next());
        ArrayList<Integer> l = new ArrayList<>();
        for(int i =0; i < N ;i++){
            l.add(Integer.parseInt(sc.next()));
        }
        Collections.sort(l);
        if(l.get(l.size()/2) == l.get(l.size()/2-1)){
            System.out.println(0);
        }else{
            System.out.println(l.get(l.size()/2)-l.get(l.size()/2-1));
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        ArrayList<Integer> l = new ArrayList<>();
        for(int i =0; i < N ;i++){
            l.add(Integer.parseInt(sc.next()));
        }
        Collections.sort(l);
        if(l.get(l.size()/2) == l.get(l.size()/2-1)){
            System.out.println(0);
        }else{
            System.out.println(l.get(l.size()/2)-l.get(l.size()/2-1));
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        ArrayList<Integer> l = new ArrayList<>();
        for(int i =0; i < N ;i++){
            l.add(Integer.parseInt(sc.next()));
        }
        Collections.sort(l);
        if(l.get(l.size()/2) == l.get(l.size()/2-1)){
            System.out.println(0);
        }else{
            System.out.println(l.get(l.size()/2)-l.get(l.size()/2-1));
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc ArrayList<Integer> l = new ArrayList<>(); l new ArrayList<>() for(int i =0; i < N ;i++){
            l.add(Integer.parseInt(sc.next()));
        } int i =0; int i =0; i 0 i < N i N i++ i++ i {
            l.add(Integer.parseInt(sc.next()));
        } {
            l.add(Integer.parseInt(sc.next()));
        } l.add(Integer.parseInt(sc.next())) l.add l Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Collections.sort(l) Collections.sort Collections l if(l.get(l.size()/2) == l.get(l.size()/2-1)){
            System.out.println(0);
        }else{
            System.out.println(l.get(l.size()/2)-l.get(l.size()/2-1));
        } l.get(l.size()/2) == l.get(l.size()/2-1) l.get(l.size()/2) l.get l l.size()/2 l.size() l.size l 2 l.get(l.size()/2-1) l.get l l.size()/2-1 l.size()/2 l.size() l.size l 2 1 {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 {
            System.out.println(l.get(l.size()/2)-l.get(l.size()/2-1));
        } System.out.println(l.get(l.size()/2)-l.get(l.size()/2-1)) System.out.println System.out System System.out l.get(l.size()/2)-l.get(l.size()/2-1) l.get(l.size()/2) l.get l l.size()/2 l.size() l.size l 2 l.get(l.size()/2-1) l.get l l.size()/2-1 l.size()/2 l.size() l.size l 2 1 String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        ArrayList<Integer> l = new ArrayList<>();
        for(int i =0; i < N ;i++){
            l.add(Integer.parseInt(sc.next()));
        }
        Collections.sort(l);
        if(l.get(l.size()/2) == l.get(l.size()/2-1)){
            System.out.println(0);
        }else{
            System.out.println(l.get(l.size()/2)-l.get(l.size()/2-1));
        }
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        ArrayList<Integer> l = new ArrayList<>();
        for(int i =0; i < N ;i++){
            l.add(Integer.parseInt(sc.next()));
        }
        Collections.sort(l);
        if(l.get(l.size()/2) == l.get(l.size()/2-1)){
            System.out.println(0);
        }else{
            System.out.println(l.get(l.size()/2)-l.get(l.size()/2-1));
        }
    }
} Main
import java.util.ArrayList;
import java.util.Arrays;
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 = Integer.parseInt(sc.next());
        ArrayList<Integer> l = new ArrayList<>();
        for(int i =0; i < N ;i++){
            l.add(Integer.parseInt(sc.next()));
        }
        Collections.sort(l);
        if(l.get(l.size()/2) == l.get(l.size()/2-1)){
            System.out.println(0);
        }else{
            System.out.println(l.get(l.size()/2)-l.get(l.size()/2-1));
        }
    }
}