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

public class Main {

	public static void main(String[] args) {

		int array[] = null;
		int temp = 0;

		Scanner scanner = new Scanner(System.in);

		//入力値を扱いやすいように配列化
		for(int i = 0; scanner.hasNext(); i++) {

			//最初の入力で配列作成
			if(i == 0) {

				temp = Integer.parseInt(scanner.next());

				array = new int[temp];

			}
			
			array[i] = Integer.parseInt(scanner.next());
			
		}

		//照準ソート
		Arrays.sort(array);

		//間の値の差を求める
		System.out.println((array[(temp / 2)] - array[((temp / 2) -1)]));
		
	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		int array[] = null;
		int temp = 0;

		Scanner scanner = new Scanner(System.in);

		//入力値を扱いやすいように配列化
		for(int i = 0; scanner.hasNext(); i++) {

			//最初の入力で配列作成
			if(i == 0) {

				temp = Integer.parseInt(scanner.next());

				array = new int[temp];

			}
			
			array[i] = Integer.parseInt(scanner.next());
			
		}

		//照準ソート
		Arrays.sort(array);

		//間の値の差を求める
		System.out.println((array[(temp / 2)] - array[((temp / 2) -1)]));
		
	}

} Main public static void main(String[] args) {

		int array[] = null;
		int temp = 0;

		Scanner scanner = new Scanner(System.in);

		//入力値を扱いやすいように配列化
		for(int i = 0; scanner.hasNext(); i++) {

			//最初の入力で配列作成
			if(i == 0) {

				temp = Integer.parseInt(scanner.next());

				array = new int[temp];

			}
			
			array[i] = Integer.parseInt(scanner.next());
			
		}

		//照準ソート
		Arrays.sort(array);

		//間の値の差を求める
		System.out.println((array[(temp / 2)] - array[((temp / 2) -1)]));
		
	} main {

		int array[] = null;
		int temp = 0;

		Scanner scanner = new Scanner(System.in);

		//入力値を扱いやすいように配列化
		for(int i = 0; scanner.hasNext(); i++) {

			//最初の入力で配列作成
			if(i == 0) {

				temp = Integer.parseInt(scanner.next());

				array = new int[temp];

			}
			
			array[i] = Integer.parseInt(scanner.next());
			
		}

		//照準ソート
		Arrays.sort(array);

		//間の値の差を求める
		System.out.println((array[(temp / 2)] - array[((temp / 2) -1)]));
		
	} int array[] = null; array null int temp = 0; temp 0 Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) for(int i = 0; scanner.hasNext(); i++) {

			//最初の入力で配列作成
			if(i == 0) {

				temp = Integer.parseInt(scanner.next());

				array = new int[temp];

			}
			
			array[i] = Integer.parseInt(scanner.next());
			
		} int i = 0; int i = 0; i 0 scanner.hasNext() scanner.hasNext scanner i++ i++ i {

			//最初の入力で配列作成
			if(i == 0) {

				temp = Integer.parseInt(scanner.next());

				array = new int[temp];

			}
			
			array[i] = Integer.parseInt(scanner.next());
			
		} {

			//最初の入力で配列作成
			if(i == 0) {

				temp = Integer.parseInt(scanner.next());

				array = new int[temp];

			}
			
			array[i] = Integer.parseInt(scanner.next());
			
		} if(i == 0) {

				temp = Integer.parseInt(scanner.next());

				array = new int[temp];

			} i == 0 i 0 {

				temp = Integer.parseInt(scanner.next());

				array = new int[temp];

			} temp = Integer.parseInt(scanner.next()) temp Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner array = new int[temp] array new int[temp] temp array[i] = Integer.parseInt(scanner.next()) array[i] array i Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner Arrays.sort(array) Arrays.sort Arrays array System.out.println((array[(temp / 2)] - array[((temp / 2) -1)])) System.out.println System.out System System.out (array[(temp / 2)] - array[((temp / 2) -1)]) array[(temp / 2)] array (temp / 2) temp 2 array[((temp / 2) -1)] array ((temp / 2) -1) (temp / 2) temp 2 1 String[] args args public class Main {

	public static void main(String[] args) {

		int array[] = null;
		int temp = 0;

		Scanner scanner = new Scanner(System.in);

		//入力値を扱いやすいように配列化
		for(int i = 0; scanner.hasNext(); i++) {

			//最初の入力で配列作成
			if(i == 0) {

				temp = Integer.parseInt(scanner.next());

				array = new int[temp];

			}
			
			array[i] = Integer.parseInt(scanner.next());
			
		}

		//照準ソート
		Arrays.sort(array);

		//間の値の差を求める
		System.out.println((array[(temp / 2)] - array[((temp / 2) -1)]));
		
	}

} public class Main {

	public static void main(String[] args) {

		int array[] = null;
		int temp = 0;

		Scanner scanner = new Scanner(System.in);

		//入力値を扱いやすいように配列化
		for(int i = 0; scanner.hasNext(); i++) {

			//最初の入力で配列作成
			if(i == 0) {

				temp = Integer.parseInt(scanner.next());

				array = new int[temp];

			}
			
			array[i] = Integer.parseInt(scanner.next());
			
		}

		//照準ソート
		Arrays.sort(array);

		//間の値の差を求める
		System.out.println((array[(temp / 2)] - array[((temp / 2) -1)]));
		
	}

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

public class Main {

	public static void main(String[] args) {

		int array[] = null;
		int temp = 0;

		Scanner scanner = new Scanner(System.in);

		//入力値を扱いやすいように配列化
		for(int i = 0; scanner.hasNext(); i++) {

			//最初の入力で配列作成
			if(i == 0) {

				temp = Integer.parseInt(scanner.next());

				array = new int[temp];

			}
			
			array[i] = Integer.parseInt(scanner.next());
			
		}

		//照準ソート
		Arrays.sort(array);

		//間の値の差を求める
		System.out.println((array[(temp / 2)] - array[((temp / 2) -1)]));
		
	}

}