Score : $2000$ points
There are $N$ boxes arranged in a row from left to right. The $i$-th box from the left contains $a_i$ manju (buns stuffed with bean paste). Sugim and Sigma play a game using these boxes. They alternately perform the following operation. Sugim goes first, and the game ends when a total of $N$ operations are performed.
At the end of the game, each player can have the manju in the boxes in which he put his pieces. They love manju, and each of them is wise enough to perform the optimal moves in order to have the maximum number of manju at the end of the game.
Find the number of manju that each player will have at the end of the game.
Input is given from Standard Input in the following format:
$N$ $a_1$ $a_2$ $...$ $a_N$
Print the numbers of Sugim's manju and Sigma's manju at the end of the game, in this order, with a space in between.
5 20 100 10 1 10
120 21
If the two performs the optimal moves, the game proceeds as follows:
6 4 5 1 1 4 5
11 9
5 1 10 100 10 1
102 20