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

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

    while (in.hasNext()) {
      int N = in.nextInt();
      int[] d = new int[N];

      for (int i = 0; i < d.length; ++i) {
        d[i] = in.nextInt();
      }

      Arrays.sort(d);
      int mid1 = d[N / 2 - 1];
      int mid2 = d[N / 2];
      
      System.out.println(mid2 - mid1);
    }
  }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int[] d = new int[N];

      for (int i = 0; i < d.length; ++i) {
        d[i] = in.nextInt();
      }

      Arrays.sort(d);
      int mid1 = d[N / 2 - 1];
      int mid2 = d[N / 2];
      
      System.out.println(mid2 - mid1);
    }
  }
} Main public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int[] d = new int[N];

      for (int i = 0; i < d.length; ++i) {
        d[i] = in.nextInt();
      }

      Arrays.sort(d);
      int mid1 = d[N / 2 - 1];
      int mid2 = d[N / 2];
      
      System.out.println(mid2 - mid1);
    }
  } main {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int[] d = new int[N];

      for (int i = 0; i < d.length; ++i) {
        d[i] = in.nextInt();
      }

      Arrays.sort(d);
      int mid1 = d[N / 2 - 1];
      int mid2 = d[N / 2];
      
      System.out.println(mid2 - mid1);
    }
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) while (in.hasNext()) {
      int N = in.nextInt();
      int[] d = new int[N];

      for (int i = 0; i < d.length; ++i) {
        d[i] = in.nextInt();
      }

      Arrays.sort(d);
      int mid1 = d[N / 2 - 1];
      int mid2 = d[N / 2];
      
      System.out.println(mid2 - mid1);
    } in.hasNext() in.hasNext in {
      int N = in.nextInt();
      int[] d = new int[N];

      for (int i = 0; i < d.length; ++i) {
        d[i] = in.nextInt();
      }

      Arrays.sort(d);
      int mid1 = d[N / 2 - 1];
      int mid2 = d[N / 2];
      
      System.out.println(mid2 - mid1);
    } int N = in.nextInt(); N in.nextInt() in.nextInt in int[] d = new int[N]; d new int[N] N for (int i = 0; i < d.length; ++i) {
        d[i] = in.nextInt();
      } int i = 0; int i = 0; i 0 i < d.length i d.length d d.length ++i ++i i {
        d[i] = in.nextInt();
      } {
        d[i] = in.nextInt();
      } d[i] = in.nextInt() d[i] d i in.nextInt() in.nextInt in Arrays.sort(d) Arrays.sort Arrays d int mid1 = d[N / 2 - 1]; mid1 d[N / 2 - 1] d N / 2 - 1 N / 2 N 2 1 int mid2 = d[N / 2]; mid2 d[N / 2] d N / 2 N 2 System.out.println(mid2 - mid1) System.out.println System.out System System.out mid2 - mid1 mid2 mid1 String[] args args public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int[] d = new int[N];

      for (int i = 0; i < d.length; ++i) {
        d[i] = in.nextInt();
      }

      Arrays.sort(d);
      int mid1 = d[N / 2 - 1];
      int mid2 = d[N / 2];
      
      System.out.println(mid2 - mid1);
    }
  }
} public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int[] d = new int[N];

      for (int i = 0; i < d.length; ++i) {
        d[i] = in.nextInt();
      }

      Arrays.sort(d);
      int mid1 = d[N / 2 - 1];
      int mid2 = d[N / 2];
      
      System.out.println(mid2 - mid1);
    }
  }
} Main
import java.util.Scanner;
import java.util.Arrays;

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

    while (in.hasNext()) {
      int N = in.nextInt();
      int[] d = new int[N];

      for (int i = 0; i < d.length; ++i) {
        d[i] = in.nextInt();
      }

      Arrays.sort(d);
      int mid1 = d[N / 2 - 1];
      int mid2 = d[N / 2];
      
      System.out.println(mid2 - mid1);
    }
  }
}