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

public class Main {

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

		int n = sc.nextInt();
		int[] d = new int[n];
		int num1 = 0;
		int num2 = 0;

		int cntarc = 0;
		int cntabc = 0;

		int cnt = 0;

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

		Arrays.sort(d);
		num1 = d[((d.length -1) / 2) + 1];
		num2 = d[(d.length -1) / 2];

		System.out.println(num1 - num2);

	}
} import java.util.Arrays; Arrays 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();
		int[] d = new int[n];
		int num1 = 0;
		int num2 = 0;

		int cntarc = 0;
		int cntabc = 0;

		int cnt = 0;

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

		Arrays.sort(d);
		num1 = d[((d.length -1) / 2) + 1];
		num2 = d[(d.length -1) / 2];

		System.out.println(num1 - num2);

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

		int n = sc.nextInt();
		int[] d = new int[n];
		int num1 = 0;
		int num2 = 0;

		int cntarc = 0;
		int cntabc = 0;

		int cnt = 0;

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

		Arrays.sort(d);
		num1 = d[((d.length -1) / 2) + 1];
		num2 = d[(d.length -1) / 2];

		System.out.println(num1 - num2);

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

		int n = sc.nextInt();
		int[] d = new int[n];
		int num1 = 0;
		int num2 = 0;

		int cntarc = 0;
		int cntabc = 0;

		int cnt = 0;

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

		Arrays.sort(d);
		num1 = d[((d.length -1) / 2) + 1];
		num2 = d[(d.length -1) / 2];

		System.out.println(num1 - num2);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] d = new int[n]; d new int[n] n int num1 = 0; num1 0 int num2 = 0; num2 0 int cntarc = 0; cntarc 0 int cntabc = 0; cntabc 0 int cnt = 0; cnt 0 for (int i = 0; i < d.length; i++) {
			d[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < d.length i d.length d d.length i++ i++ i {
			d[i] = sc.nextInt();
		} {
			d[i] = sc.nextInt();
		} d[i] = sc.nextInt() d[i] d i sc.nextInt() sc.nextInt sc Arrays.sort(d) Arrays.sort Arrays d num1 = d[((d.length -1) / 2) + 1] num1 d[((d.length -1) / 2) + 1] d ((d.length -1) / 2) + 1 ((d.length -1) / 2) (d.length -1) d.length d d.length 1 2 1 num2 = d[(d.length -1) / 2] num2 d[(d.length -1) / 2] d (d.length -1) / 2 (d.length -1) d.length d d.length 1 2 System.out.println(num1 - num2) System.out.println System.out System System.out num1 - num2 num1 num2 String[] args args public class Main {

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

		int n = sc.nextInt();
		int[] d = new int[n];
		int num1 = 0;
		int num2 = 0;

		int cntarc = 0;
		int cntabc = 0;

		int cnt = 0;

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

		Arrays.sort(d);
		num1 = d[((d.length -1) / 2) + 1];
		num2 = d[(d.length -1) / 2];

		System.out.println(num1 - num2);

	}
} public class Main {

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

		int n = sc.nextInt();
		int[] d = new int[n];
		int num1 = 0;
		int num2 = 0;

		int cntarc = 0;
		int cntabc = 0;

		int cnt = 0;

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

		Arrays.sort(d);
		num1 = d[((d.length -1) / 2) + 1];
		num2 = d[(d.length -1) / 2];

		System.out.println(num1 - num2);

	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

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

		int n = sc.nextInt();
		int[] d = new int[n];
		int num1 = 0;
		int num2 = 0;

		int cntarc = 0;
		int cntabc = 0;

		int cnt = 0;

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

		Arrays.sort(d);
		num1 = d[((d.length -1) / 2) + 1];
		num2 = d[(d.length -1) / 2];

		System.out.println(num1 - num2);

	}
}