#C5548. Find the Median

    ID: 49209 Type: Default 1000ms 256MiB

Find the Median

Find the Median

Given a sequence of integers, your task is to find the median of the sequence. The median is defined as the middle element after sorting the list in non-decreasing order. You can assume that the input will always have an odd number of elements.

For example, if the input list is: [1, 2, 3, 4, 5], after sorting it remains the same and the median is 3.

Please note that the input will be provided via standard input (stdin) and the output should be written to standard output (stdout).

inputFormat

The first line contains a single integer n denoting the number of integers. The second line contains n space-separated integers.

You can assume that n is always odd.

outputFormat

Output a single integer, which is the median of the given list of integers.

## sample
5
1 2 3 4 5
3