Antenna
InterviewTime limit1sMemory limit256 MB
Given positions of houses on a line, pick the house position that minimizes the total distance to all houses, choosing the smallest such position on ties.
Problem
Several houses are located along a straight line in a village. The village decided to install a single antenna at one of the houses at a specific position. For efficiency, the antenna must be installed where the total distance from the antenna to every house is minimized. The antenna can only be installed at a position where a house is located, and logically, multiple houses can exist at the same position.
Given the positions of the houses, write a program that selects the position to install the antenna.
For example, suppose and the positions are 1, 5, 7, and 9.

In this case, installing at position 5 minimizes the total distance from the antenna to every house to .
Input
The first line gives the number of houses as a natural number. () The second line gives the positions of the houses, separated by spaces, as natural numbers between 1 and 100,000 inclusive.
Output
Print the position value at which to install the antenna on the first line. If multiple position values are possible for installing the antenna, print the smallest one.