E. Calculating Costs
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Cameron is a cashier for a store and at the end of the day, Cameron wrote down the money he got from each customer throughout the day. His manager wants the mean, median, and mode of the list of money from each customer. The manager wants all numbers to be rounded down to the nearest integer, and if there are multiple modes, then the manager wants the largest mode. If the number of customers that day was even, then the manager wants the median to be the average of the two middle numbers, rounded down.

Input

The first line has an integer $$$1 \lt N \leq 1000$$$, representing the number of customers throughout the day.

The second line has $$$N$$$ space-separated integers, $$$1 \leq K \leq 1000$$$, where $$$K$$$ represents each space-separated integer.

Output

Print the mean, median, and mode of the list of numbers in that order, each on a separate line, rounding down to the nearest integer.

Example
Input
5
3 7 5 18 7
Output
8
7
7
Note

Problem idea: Spark

Problem preparation: Spark

Occurances: Novice 5