There is the faculty of Computer Science in Berland. In the social net "TheContact!" for each course of this faculty there is the special group whose name equals the year of university entrance of corresponding course of students at the university. 

Each of students joins the group of his course and joins all groups for which the year of student's university entrance differs by no more than x from the year of university entrance of this student, where x — some non-negative integer. A value x is not given, but it can be uniquely determined from the available data. Note that students don't join other groups. 

You are given the list of groups which the student Igor joined. According to this information you need to determine the year of Igor's university entrance.


-----Input-----

The first line contains the positive odd integer n (1 ≤ n ≤ 5) — the number of groups which Igor joined. 

The next line contains n distinct integers a_1, a_2, ..., a_{n} (2010 ≤ a_{i} ≤ 2100) — years of student's university entrance for each group in which Igor is the member.

It is guaranteed that the input data is correct and the answer always exists. Groups are given randomly.


-----Output-----

Print the year of Igor's university entrance. 


-----Examples-----
Input
3
2014 2016 2015

Output
2015

Input
1
2050

Output
2050



-----Note-----

In the first test the value x = 1. Igor entered the university in 2015. So he joined groups members of which are students who entered the university in 2014, 2015 and 2016.

In the second test the value x = 0. Igor entered only the group which corresponds to the year of his university entrance.

Difficulty: EASY
Tags: Sorting

Implementation
Skill types: Sorting

Starter code:

Solutions:
n = int(input())
l = sorted(map(int, input().split()))
if n == 1:
	print(l[0])
else:
	m = l[1] - l[0]
	n = l[len(l) - 1] - l[1]
	k = abs(n - m)
	p = 1
	for i in range(1, len(l) - 1):
		c = l[i] - l[0]
		d = l[len(l) - 1] - l[i]
		if abs(c - d) < k:
			k = abs(c - d)
			p = i
	print(l[p])


n = int(input())
lst = [int(i) for i in input().split()]
if n == 1:
	print(lst[0])
else:
	lst.sort()
	if n % 2 == 0:
		k = n // 2
		d = k - 1
		print((lst[k] + lst[d]) // 2)
	else:
		print(lst[n // 2])


n = int(input())
a = sorted(list(map(int, input().split())))
print(a[n // 2])


n = int(input())
l = list(map(int, input().split()))
l.sort()
print(l[(n - 1) // 2])


N = int(input())
print(sorted(list(map(int, input().split())))[N // 2])


n = int(input())
l = list(map(int, input().split(' ')))
l = sorted(l)
print(l[(n - 1) // 2])


n = int(input())
a = list(map(int, input().split()))
print(sum(a) // n)


n = int(input())
x = [int(x) for x in input().split()]
x.sort()
print(x[n // 2])


n = input()
years = tuple(map(lambda x: int(x), input().split(' ')))
print((max(years) + min(years)) // 2)


n = int(input())
l = [int(i) for i in input().split()]
l.sort()
print(l[n // 2])


n = int(input())
List = sorted(list(map(int, input().split())))
print(List[len(List) // 2])


import sys
fin = sys.stdin
fout = sys.stdout
n = int(fin.readline())
a = set(map(int, fin.readline().split()))
fout.write(str(sum(a) // len(a)))


input1 = list(map(int, input().split()))
input2 = list(map(int, input().split()))
min = min(input2)
max = max(input2)
print((min + max) // 2)


n = int(input())
f = list(map(int, input().split()))
f.sort()
g = [-1, -1]
for i in f:
	if g[-1] != i:
		g.append(i)
print(g[len(g) // 2 + 1])


n = int(input())
arr = list(map(int, input().split()))
arr.sort()
print((arr[0] + arr[-1]) // 2)


n = int(input())
b = [int(x) for x in input().split()]
b.sort()
print(int((b[0] + b[-1]) / 2))


col = input()
r = input().split(' ')
col = len(r)
su = 0
for i in r:
	su += int(i)
res = int(su / col)
print(res)


a = int(input())
b = []
b = input().split(' ')
c = int()
for i in range(a):
	c = c + int(b[i])
print(c // a)


n = int(input())
l = sorted(list(map(int, input().split())))
while len(l) > 1:
	l.pop()
	l.pop(0)
print(l[0])


n = int(input())
l = list(map(int, input().split()))
mi = l[0]
ma = l[0]
for p in l:
	mi = min(mi, p)
	ma = max(ma, p)
ans = l[0]
dif = ma - mi
for p in l:
	if abs(ma - p - (p - mi)) < abs(ma - ans - (ans - mi)):
		ans = p
print(ans)


n = int(input())
years = input().split()
arr = list()
for j in range(len(years)):
	arr.append(int(years[j]))
min_value = min(arr)
max_value = max(arr)
ans = (min_value + max_value) // 2
print(ans)


n = int(input())
l = list(map(int, input().split()))
print((max(l) + min(l)) // 2)


n = int(input())
A = list(map(int, input().split()))
B = 0
C = 10000000000000
for i in range(n):
	B = max(B, A[i])
	C = min(C, A[i])
D = (C + B) // 2
print(D)


n = int(input())
M = list(map(int, input().split()))
M.sort()
print(M[len(M) // 2])


(n, a) = (int(input()), list(map(int, input().split())))
print(min(a) + max(a) >> 1)


n = int(input())
line = list(map(int, input().split()))
mi = min(line)
ma = max(line)
print(mi + (ma - mi) // 2)


def main():
	n = input()
	xs = sorted((int(x) for x in input().split()))
	print(xs[len(xs) // 2])
main()


import math
n = int(input())
s = ' '.join(input().split()).split(' ')
av = 0
for i in range(0, n):
	av += int(s[i])
av /= n
print(math.ceil(av))


n = int(input())
groups = input().split(' ')
groups = sorted(groups)
print(groups[n // 2])


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
n = ii()
print(sorted(li())[n // 2])


n = int(input())
x = list(map(int, input().split()))
print(sum(x) // n)


n = int(input())
a = list(map(int, input().split()))
print((min(a) + max(a)) // 2)


n = int(input())
a = list(map(int, input().split()))
a.sort()
print(a[n // 2])


n = int(input())
A = list(map(int, input().split()))
print(min(A) + int(n / 2))


def Func(x, a):
	for i in range(len(a)):
		osnov = a[i]
		if Otlich(osnov, a[0:i] + a[i + 1:len(a)], x):
			return [True, osnov]
	return [False]

def Otlich(osnov, a, x):
	for i in range(len(a)):
		if abs(a[i] - osnov) > x:
			return False
	return True
n = int(input())
a = list(map(int, input().split()))
x = 1
if len(a) == 1:
	print(a[0])
else:
	while x <= 100:
		b = Func(x, a)
		if not b[0]:
			x = x + 1
		else:
			print(b[1])
			break


n = int(input())
a = []
a = input().split()
i = 0
s = 0
while i < n:
	s = s + int(a[i])
	i = i + 1
x = s / n
print(int(x))


n = int(input())
R = lambda : map(int, input().split())
l = list(R())
l.sort()
print(l[(n - 1) // 2])


def university_entrance(years):
	years = sorted(years)
	mid = len(years) // 2
	print(years[mid])
n = input()
years = list(map(int, input().split()))
university_entrance(years)


n = int(input())
years = list(map(int, input().split()))
years.sort()
print(years[n // 2])


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from itertools import repeat
n = int(input())
a = sorted([*map(int, input().split())])
if n == 1:
	print(a[0])
elif n == 3:
	print(a[1])
elif n == 5:
	print(a[2])


N = int(input())
years = [int(i) for i in input().strip().split()]
print(int(sum(years) / N))


n = int(input())
A = list(map(int, input().split()))
print(sum(A) // n)


n = int(input())
arr = list(map(int, input().split()))
print(sum(arr) // n)


n = int(input())
arr = sorted([int(i) for i in input().strip().split(' ')])
print(arr[len(arr) // 2])


n = int(input())
s = [int(x) for x in input().split()]
print(int((max(s) + min(s)) / 2))


n = input()
years = [int(s) for s in input().split()]
print(sum(years) // int(n))


query = int(input())
year = list(map(int, input().split()))
year.sort()
if query == 1:
	print(year[0])
else:
	d = year[query - 1] - year[0]
	print(year[0] + d // 2)


n = int(input())
k = list(map(int, input().split()))
print(sorted(k)[n // 2])


num = int(input())
groups = list(map(int, input().split()))
groups.sort()
print(groups[len(groups) // 2])


n = int(input())
a = list(map(int, input().split()))
a.sort()
stgr = 0
for i in range(1, n):
	if a[i] - a[i - 1] > 1:
		print(a[(stgr + i) // 2], end=' ')
		stgr = i
print(a[(stgr + n - 1) // 2])


__author__ = 'Ryabchun Vladimir'
n = int(input())
sum_years = 0
groups = list(map(int, input().split()))
for elem in groups:
	sum_years += elem
print(int(sum_years / n))


T_ON = 0
DEBUG_ON = 1
MOD = 998244353

def solve():
	n = read_int()
	A = read_ints()
	A.sort()
	print(A[n // 2])

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def fib_to_n(n):
	f = []
	(a, b) = (0, 1)
	while a <= n:
		f.append(a)
		(a, b) = (b, a + b)
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def is_even(x):
	return x % 2 == 0

def is_odd(x):
	return x % 2 == 1

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P

def is_lucky(n):
	return set(list(str(n))).issubset({'4', '7'})
main()


a = int(input())
t = list(map(int, input().split()))
t.sort()
if a % 2 == 0:
	print(min(t))
else:
	print(t[a // 2])


n = input()
years = [int(el) for el in input().split()]
years.sort()
print(years[int((len(years) - 1) / 2)])


n = int(input())
second_arr = input().split()
years = [int(item) for item in second_arr]
years.sort()
print(years[n // 2])


n = int(input())
m = list(map(int, input().split()))
m = sorted(m)
print(m[n // 2])


n = int(input())
a = sorted(map(int, input().split()))
print(a[n >> 1])


def main():
	(n, d) = (int(input()), 0)
	print(sorted(list(map(int, input().split())))[n // 2])
main()


n = int(input())
n1 = list(map(int, input().split()))
n1.sort()
s = n // 2
print(n1[s])


n = int(input())
nums = list(map(int, input().split()))
nums.sort()
print(nums[n // 2])


n = int(input())
y = list(map(int, input().split()))
y.sort()
if n == 1:
	print(y[0])
else:
	print(y[(n + 1) // 2 - 1])


n = int(input())
years = map(int, input().split())
print(sum(years) // n)


count = int(input())
sum = 0
years = input().split(' ')
for y in years:
	sum += int(y)
print(int(sum / count))


n = int(input())
s = list(map(int, input().split()))
print(int((min(s) + max(s)) / 2))


n = int(input())
p = 0
for x in input().split():
	p = p + int(x)
print(p // n)


def list_from_input():
	return list(map(int, input().split()))

def read():
	return eval(input())

def main():
	n = read()
	years = list_from_input()
	print(sorted(years)[n // 2])
main()


n = int(input())
A = list(map(int, input().split()))
A.sort()
print(A[(n - 1) // 2])


n = int(input())
k = input().split()
min = 10000
max = 0
for i in range(0, n):
	if min > int(k[i]):
		min = int(k[i])
	if max < int(k[i]):
		max = int(k[i])
print(int((min + max) / 2))


def Main():
	n = int(input())
	syears = input().split()
	years = []
	for item in syears:
		years.append(int(item))
	greatest = max(years)
	smallest = min(years)
	result = int((greatest + smallest) / 2)
	print(result)
Main()


n = int(input())
years = sorted([int(x) for x in input().split()])
print(years[int(n / 2)])


year = 0
x = input()
groups = input().split(' ')
for i in range(len(groups)):
	groups[i] = int(groups[i])
	year += groups[i]
year = int(year / len(groups))
print(year)


n = int(input())
A = input().split()
print(int((int(max(A)) + int(min(A))) / 2))


n = input()
l = [int(x) for x in input().split()]
print((min(l) + max(l)) // 2)


n = int(input())
x = [int(x) for x in input().split()]
x.sort()
if n % 2 == 0:
	print(x[n // 2 - 1])
else:
	print(x[n // 2])


n = list(map(int, input().split()))
z = sorted(list(map(int, input().split())))
print(z[len(z) // 2])


n = int(input())
arr = []
string = str(input())
years = string.split(' ')
for i in years:
	arr.append(int(i))
arr.sort()
print(arr[n // 2])


a = []
n = int(input())
b = input()
a = b.split(' ')
a.sort()
d = int((n - 1) / 2)
c = a[d]
print(c)


x = int(input())
a = list(map(int, input().split()))
a.sort()
print((a[0] + a[-1]) // 2)


(lambda n: print(sorted(list(map(int, input().split())))[n // 2]))(int(input()))


q = input()
a = list(map(int, input().split()))
print((max(a) + min(a)) // 2)


q = int(input())
mas = list(map(int, input().split()))
print(int(sum(mas) / q))


def main():
	n = int(input())
	groups = input()
	groups = list(sorted(groups.split(' ')))
	n_map = {1: 0, 3: 1, 5: 2}
	print(groups[n_map[n]])
main()


def solve(case_no):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	print(a[n // 2])
t = 1
for i in range(1, t + 1):
	solve(i)


def main():
	num = int(input())
	years = [int(x) for x in input().split()]
	years = sorted(years)
	x = num // 2
	print(years[x])
main()


n = int(input())
a = list(map(int, input().split()))
a.sort()
if n == 1:
	print(a[0])
elif n == 3:
	print(a[1])
elif n == 5:
	print(a[2])


n = int(input())
a = list(map(int, input().split()))
a.sort()
if n % 2 != 0:
	print(a[n // 2])
else:
	print(a[n // 2])


n = int(input())
print(sorted(map(int, input().split()))[n // 2])


from statistics import median
input()
print(median(map(int, input().split())))


input()
a = list(map(int, input().split()))
mi = ma = a[0]
for i in a:
	mi = min(mi, i)
	ma = max(ma, i)
print((mi + ma) // 2)


n = int(input())
a = [int(i) for i in input().split()]
a.sort()
print(a[n - 1] - n // 2)


n = int(input())
l = list(map(int, input().split()))
if n % 2 != 0:
	mid = n // 2
else:
	mid = n // 2 + 1
l.sort()
print(l[mid])


n = int(input())
rdl = []
rdl = list(map(int, input().split()))
if n == 1:
	print(rdl[0])
else:
	rdl.sort()
	if rdl[n - 1] - rdl[n // 2] == rdl[n // 2] - rdl[0]:
		print(rdl[n // 2])
	elif rdl[n - 1] - rdl[n // 2] > rdl[n // 2] - rdl[0]:
		print(rdl[n // 2 + 1])
	else:
		print(rdl[n // 2 - 1])


import statistics
n = int(input())
arr = input().split(' ')
print(statistics.median(arr))


n = int(input())
lst = [int(i) for i in input().split()]
lst.sort()
if n == 1:
	print(lst[0])
elif n == 3:
	print(lst[1])
else:
	print(lst[2])


a = input()
arr = []
b = input().split(' ')
for j in range(len(b)):
	arr.append(int(b[j]))
c = sorted(arr)
print(c[len(c) // 2])


def main():
	groups = int(input())
	years = [int(x) for x in input().split()]
	years.sort()
	if groups == 1:
		print(years[0])
	elif groups == 3:
		print(years[1])
	elif groups == 5:
		print(years[2])
main()


x = int(input())
a = [int(s) for s in input().split()]
a_min = 2200
for i in range(x):
	if a[i] < a_min:
		a_min = a[i]
print(a_min + (x - 1) // 2)


n = int(input())
a = sorted([int(i) for i in input().split()])
print(a[n // 2])


(n, ar) = (int(input()), sorted(list(map(int, input().split()))))
print(ar[n // 2])


input()
a = list(map(int, input().split()))
a.sort()
print(a[len(a) // 2])


n = int(input())
group = list(map(int, input().split()))
if n == 1:
	print(group[0])
else:
	group.sort()
	if n == 3:
		print(group[1])
	else:
		print(group[2])


n = int(input())
ai = list(map(int, input().split()))
ai.sort()
print(ai[n // 2])


n = int(input())
a = [int(s) for s in input().split()]
print(sum(a) // n)


n = int(input())
li = list(map(int, input().split()))
li.sort()
print(li[n // 2])


n = int(input())
groups = [int(g) for g in input().split(' ')]
sum = 0
for group in groups:
	sum += group
print(sum // n)


def main():
	n = int(input())
	groups = set(map(int, input().split()))
	average = sum(groups)
	mid = average // len(groups)
	print(mid)
main()


n = int(input())
nums = list(map(int, input().split(' ')))
minX = 2100
maxX = 2010
for x in nums:
	minX = min(x, minX)
	maxX = max(x, maxX)
print((maxX + minX) // 2)


n = int(input())
a = list(map(int, input().split()))
s = a[0]
if n > 1:
	for i in range(1, n):
		s += a[i]
year = s // n
print(year)


t = int(input())
arr = list(map(int, input().split()))
arr.sort()
print(arr[t // 2])


n = int(input())
s = sorted(input().split())
print(s[n // 2])


n = int(input())
s = list(map(int, input().split()))
print(sum(s) // n)


n = int(input())
l = list(map(int, input().split()))
print(sum(l) // n)


n = int(input())
lst = list(map(int, input().split()))
print(int((max(lst) + min(lst)) / 2))


def BubbleSort(A):
	for j in range(len(A) - 1, 0, -1):
		for i in range(0, j):
			if A[i] > A[i + 1]:
				(A[i], A[i + 1]) = (A[i + 1], A[i])
	return A
n = int(input())
A = list(map(int, input().split()))
B = []
BubbleSort(A)
if n == 1:
	print(A[0])
elif n == 3:
	print(A[1])
else:
	print(A[2])


n = int(input())
courses = input().split(' ')
courses = [int(x) for x in courses]
mi = float('inf')
ma = float('-inf')
for n in courses:
	if n < mi:
		mi = n
	if n > ma:
		ma = n
ans = int((ma - mi) / 2) + mi
print(ans)


import sys
n = int(input())
y = list(map(int, sys.stdin.readline().split()))
r = 200
ans = y[0]
for i in range(n):
	c = 0
	for j in range(n):
		a = abs(y[i] - y[j])
		if a > c:
			c = a
	if c < r:
		r = c
		ans = y[i]
print(ans)


def selection_sort(l):
	for i in range(len(l)):
		min_val = l[i]
		min_val_index = i
		for j in range(i, len(l)):
			if l[j] < min_val:
				min_val = l[j]
				min_val_index = j
		(l[i], l[min_val_index]) = (l[min_val_index], l[i])
	return l

def merge_sort(l):

	def merge(l1, l2):
		output_list = []
		(i, j) = (0, 0)
		while i < len(l1) and j < len(l2):
			if l1[i] < l2[j]:
				output_list.append(l1[i])
				i += 1
			else:
				output_list.append(l2[j])
				j += 1
		if i == len(l1):
			output_list += l2[j:]
		else:
			output_list += l1[i:]
		return output_list

	def sort(li):
		if len(li) < 2:
			return li
		mid = len(li) // 2
		left = sort(li[:mid])
		right = sort(li[mid:])
		return merge(left, right)
	return sort(l)

def main_function():
	n = input()
	l = merge_sort([int(i) for i in input().split(' ')])
	return l[len(l) // 2]
print(main_function())


a = int(input()) // 2
arr = list(map(int, input().split()))
arr.sort()
print(arr[a])


n = input()
my_str = input()
my_list = my_str.split(' ')
print(sorted(my_list)[len(my_list) // 2])


n = int(input())
k = input().split(' ')
l = []
for _ in k:
	l.append(int(_))
l = sorted(l)
print(l[int(len(l) / 2)])


n = int(input())
l = [int(i) for i in input().split()]
l = sorted(l)
print(l[n // 2])


n = int(input())
a = input().split()
for i in range(n):
	a[i] = int(a[i])
c = n // 2
for i in range(c):
	for j in range(n):
		if a[j] == max(a):
			a[j] = 0
			break
print(max(a))


n = int(input())
y = sorted(map(int, input().split()))
print(y[(n - 1) // 2])


def avg(arr):
	return int(sum(arr) // len(arr))
n = int(input())
goda = input().split(' ')
goda = [int(y) for y in goda]
print(avg(goda))


input()
nums = list(map(int, input().split()))
print(sum(nums) // len(nums))


from sys import stdin, stdout
n = int(stdin.readline())
years = sorted(list(map(int, stdin.readline().split())))
if n == 1:
	stdout.write(str(years[0]))
elif n == 3:
	stdout.write(str(years[1]))
elif n == 5:
	stdout.write(str(years[2]))


n = int(input())
a = [int(x) for x in input().split()]
a.sort()
print(a[(n - 1) // 2])


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
from types import CodeType, new_class
n = int(input())
a = [int(x) for x in input().split()]
a.sort()
print(a[n // 2])


import sys

def main():
	(_, *l) = map(int, sys.stdin.read().strip().split())
	return sum(l) // len(l)
print(main())


n = int(input())
years = [int(x) for x in input().split()]
print(sum(years) // n)


n = int(input())
array = list(map(int, input().split(' ')))
if n == 1:
	print(array[0])
else:
	for i in range(1, n):
		j = i - 1
		while j >= 0 and array[j] > array[j + 1]:
			t = array[j]
			array[j] = array[j + 1]
			array[j + 1] = t
			j = j - 1
	b = 1
	for i in range(0, n - 2):
		if array[i + 1] - array[i] != 1:
			b = 0
			break
	if b == 1:
		print(str(array[n // 2]))


n = int(input())
print(min(map(int, input().split())) + n // 2)


n = int(input())
mas = list(map(int, input().split()))
print(int(sum(mas) / n))


n = int(input())
A = list(map(int, input().split()))
A.sort()
i = 0
i = n // 2
print(A[i])


a = input()
a = list(map(int, input().split()))
(m, M) = (min(a), max(a))
dr = (M + m) / 2
M = 2100
for i in a:
	if abs(i - dr) < M:
		M = abs(i - dr)
		m = i
print(m)


n = int(input())
a = list(map(int, input().split()))
mn = min(a)
mx = max(a)
print(mn + n // 2)


n = int(input())
a = [int(s) for s in input().split(' ')]
print(sorted(a)[n // 2])


n = int(input())
a = input().split()
a.sort()
print(str(a[n // 2]))


n = int(input())
y = list(map(int, input().split()))
y.sort()
print(y[n // 2])


n = int(input())
nom = [int(x) for x in input().split()]
if n == 1:
	print(nom[0])
else:
	print(int(sum(nom) / n))


n = int(input())
a = [int(x) for x in input().split()]
print(sorted(a)[n // 2])


n = int(input())
a = list(map(int, input().split()))
eggs = spam = a[0]
for i in range(1, n):
	if a[i] > spam:
		spam = a[i]
	elif a[i] < eggs:
		eggs = a[i]
print(int((spam + eggs) / 2))


n = int(input())
a = []
s = input().split(' ')
for i in range(n):
	a.append(int(s[i]))
a.sort()
x = []
for i in range(n):
	y = max(a[i] - a[0], a[n - 1] - a[i])
	x.append(y)
min = min(x)
for i in range(n):
	if x[i] == min:
		print(a[i])
		break


n = int(input())
l = sorted(list(map(int, input().split())))
print(l[len(l) // 2])


n = int(input())
y = sum((int(i) for i in input().split())) // n
print(y)


n = int(input())
s = input()
a = list(map(int, s.split(' ')))
a.sort()
if (a[0] + a[-1]) // 2 in a:
	print((a[0] + a[-1]) // 2)
else:
	for i in range(1, 91):
		t = (a[0] + a[-1]) // 2
		if t + i in a:
			print(t + i)
			break
		elif t - i in a:
			print(t - i)
			break


n = int(input())
arr = [int(x) for x in input().split()]
arr = sorted(arr)
print(arr[len(arr) // 2])


n = int(input())
(*ar,) = map(int, input().split())
ar.sort()
print(ar[int(n // 2)])


def read_tokens():
	return input().strip().split(' ')

def read_ints():
	return [int(s) for s in read_tokens()]
n = int(input())
arr = read_ints()
arr.sort()
n = len(arr)
print(arr[n // 2])


n = int(input())
a = list(map(int, input().split()))
a.sort()
print(a[n >> 1])


n = int(input())
arr = list(map(int, input().split()))
arr.sort()
print(arr[n // 2])


a = int(input())
b = sorted(list(map(int, input().split())))
if a == 1:
	print(b[0])
if a == 3:
	print(b[1])
if a == 5:
	print(b[2])


a = int(input())
b = list(input().split(' '))
s = 0
for i in b:
	s += int(i)
print(int(s / a))


n = int(input())
a = list(map(int, input().split()))
a.sort()
if n % 2 == 1:
	ind = (n - 1) // 2
	result = a[ind]
elif 2010 in a:
	ind = n // 2 - 1
	result = a[ind]
elif 2100 in a:
	ind = n // 2
	result = a[ind]
print(result)


input()
a = input()
a = str(a).split(' ')
a = [int(i) for i in a]
a.sort()
print(int((a[0] + a[len(a) - 1]) / 2))


n = int(input())
years = sorted(list(map(int, input().split())))
print(years[n // 2])


n = int(input())
arr = [int(s) for s in input().split()]
arr.sort()
print(arr[n // 2])


n = int(input())
a = list(map(int, input().split()))
a.sort()
x = n // 2 + 1
print(a[x - 1])


a = int(input())
v = list(map(int, input().split()))
v.sort()
print(v[(a + 1) // 2 - 1])


n = int(input())

def men_fun(a):
	ans = 0
	global year
	for j in range(len(year)):
		if year[j] < a:
			ans = ans + 1
	return ans

def max_fun(a):
	ans = 0
	global year
	for j in range(len(year)):
		if year[j] > a:
			ans = ans + 1
	return ans
year = list(map(int, input().split()))
if n == 1:
	print(year[0])
else:
	for i in range(n):
		if men_fun(year[i]) == max_fun(year[i]):
			print(year[i])
			break


n = int(input())
group = list(map(int, input().split()))
if n == 1:
	print(group[0])
elif n == 3:
	if group[0] != min(group) and group[0] != max(group):
		print(group[0])
	elif group[1] != min(group) and group[1] != max(group):
		print(group[1])
	else:
		print(group[2])
elif n == 5:
	sluch = []
	for i in range(n):
		if group[i] != min(group) and group[i] != max(group):
			sluch += [group[i]]
	if sluch[0] != min(sluch) and sluch[0] != max(sluch):
		print(sluch[0])
	elif sluch[1] != min(sluch) and sluch[1] != max(sluch):
		print(sluch[1])
	else:
		print(sluch[2])


class CodeforcesTask769ASolution:

	def __init__(self):
		self.result = ''
		self.n = 0
		self.years = []

	def read_input(self):
		self.n = int(input())
		self.years = [int(x) for x in input().split(' ')]

	def process_task(self):
		self.years.sort()
		self.result = str(self.years[self.n // 2])

	def get_result(self):
		return self.result
Solution = CodeforcesTask769ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


n = int(input())
arr = list(map(int, input().split()))
print((min(arr) + max(arr)) // 2)


import sys
import math
num = int(sys.stdin.readline())
years = [int(c) for c in sys.stdin.readline().split()]
years.sort()
print(years[math.floor(len(years) / 2)])


N = int(input())
A = list(map(int, input().split()))
print(min(A) + max(A) >> 1)


result = []
cout = int(input())
s = input()
inp = s.split(' ')
result = [int(i) for i in inp]
result.sort()
cout = int(cout)
if cout % 2 != 0:
	v = cout // 2 + 1
elif cout / 2 - result[0] == result[cout - 1] - cout / 2:
	v = cout / 2
else:
	v = cout / 2 + 1
v = int(v)
print(result[v - 1])


import sys
import statistics
n = int(input().strip())
arr = [int(arr_temp) for arr_temp in input().strip().split(' ')]
print(statistics.median_low(arr))


n = input()
years = tuple([int(x) for x in input().split(' ')])
print((max(years) + min(years)) // 2)


c = int(input())
y = input()
y = list(map(int, y.split()))
y = sorted(y)
print(y[len(y) // 2], end='\n')


n = int(input())
a = list(map(int, input().split()))
maxr = [0 for i in range(n)]
for i in range(n):
	for j in range(n):
		maxr[i] = max(maxr[i], abs(a[i] - a[j]))
print(a[maxr.index(min(maxr))])


count = int(input())
input_text = input()
input_text = input_text.split(' ')
sum = 0
for elem in input_text:
	sum += int(elem)
print(int(sum / count))


n = int(input())
groups = [int(i) for i in input().split()]
t = max(groups)
b = min(groups)
print(int((t + b) / 2))


import os
import sys
from io import BytesIO, IOBase
import math
from decimal import Decimal
from decimal import *
from collections import defaultdict, deque
import heapq
from decimal import Decimal
getcontext().prec = 25
abcd = 'abcdefghijklmnopqrstuvwxyz'
MOD = 1000000007
BUFSIZE = 8192
from bisect import bisect_left, bisect_right

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
l = list(map(int, input().split(' ')))
l.sort()
print(l[n // 2])


num = input()
spis = input().split(' ')
a = int(min(spis))
b = int(max(spis))
print((a + b) // 2)


n = int(input())
a = 2010
b = 2100
c = list(map(int, input().split()))
print((min(c) + max(c)) // 2)


n = int(input())
lst = sorted([int(x) for x in input().split()])
if len(lst) == 1:
	print(lst[0])
else:
	print(lst[len(lst) // 2])


n = int(input())
lst = list(map(int, input().split()))
lst.sort()
print(lst[n // 2])


n = int(input())
years = sorted(map(int, input().split()))
print(years[len(years) // 2])


import math
n = input()
inp = input().split(' ')
for i in range(len(inp)):
	inp[i] = int(inp[i])
sum = 0
for i in inp:
	sum += i
avg = sum / len(inp)
min_year = 99999
diff = 99999
for i in inp:
	if math.fabs(i - avg) < diff:
		min_year = i
		diff = math.fabs(i - avg)
print(min_year)


n = int(input())
l = list(map(int, input().split()))
l.sort()
print(l[len(l) // 2])


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	l = LI()
	if n == 1:
		return l[0]
	sl = list(set(l))
	sl = sorted(sl)
	return sl[len(sl) // 2]
print(main())


count = input()
years = input().split(' ')
years = [int(y.strip()) for y in years]
years.sort()
if len(years) == 1:
	print(years[0])
else:
	print(years[len(years) // 2])


n = int(input())
a = list(map(int, input().split()))
a.sort()
x = (a[n - 1] + a[0]) // 2
for i in range(n):
	if a[i] >= x:
		print(a[i])
		break


import collections as col
import itertools as its
import operator

class Solver:

	def solve(self):
		n = int(input())
		a = list(map(int, input().split()))
		print((max(a) + min(a)) // 2)
s = Solver()
s.solve()


n = int(input())
A = list(map(int, input().split()))
s = 0
for x in A:
	s += x
s /= n
mn = 9999
for x in A:
	if abs(s - x) < mn:
		mn = abs(s - x)
		y = x
print(y)


def god_postuplenia(lst):
	z = list()
	y = list()
	for elem in lst:
		z.append(min(2100, elem))
		y.append(max(2010, elem))
	return (min(z) + max(y)) // 2
n = int(input())
a = [int(i) for i in input().split()]
print(god_postuplenia(a))


def solve(n, arr):
	if n == 1:
		return arr[0]
	arr = sorted(list(set(arr)))
	return arr[n // 2]
n = int(input())
arr = list(map(int, input().strip().split()))[:n]
print(solve(n, arr))


input()
a = list(map(int, input().split()))
print(sum(a) // len(a))


n = int(input())
k = input().split()
if n == 1:
	print(''.join(k))
if n != 1:
	k.sort()
	if len(k) % 2 == 0:
		print(k[len(k) / 2 - 1])
	if len(k) % 2 != 0:
		print(k[len(k) // 2])