Tug of War#2353

Tug of War

1 second
64 megabytes
Medium

A tug of war is to be arranged at the local office picnic. All participants must be divided into two teams. Each person must be on one team or the other. The number of people in the teams may not differ by more than . The total weights of the two teams should be as close as possible.

Input

The first line contains , the number of people at the picnic (1 \leq n \leq 100). Each of the following lines contains a single integer between and — the weight of each person.

Output

Output a single line with two integers: the total weight of the first team and the total weight of the second team. If the numbers are different, print the smaller one first.

Examples

Example 1

Loading
Loading