The student council president wants to hold a tug-of-war at the school festival to help classmates bond.
To keep the match fair, the two teams may differ in size by at most one person, and under that condition the teams must be split so that the difference between the total weights of the two teams is as small as possible.
Print the total weight of each of the two resulting teams.
The first line contains the number of participants $N$ ($1 \le N \le 100$).
Each of the next $N$ lines contains one person's weight $K$ ($1 \le K \le 450$).
Print the total weights of the two teams in increasing order, separated by a single space.