Monkeys are hanging from the floors of a tower with floors. The floors are numbered from bottom to top. Initially, floor holds monkeys.
Ishigami and Iino take turns removing one remaining floor, with Ishigami moving first. All monkeys on the removed floor move to the highest remaining floor below it. If there is no such floor, the monkeys fall to the ground and the player who removed the floor collects them all. Monkeys that moved there on earlier turns follow the same rule.
A floor with no monkeys can also be removed. The game ends when all floors have been removed. The player with fewer monkeys wins; equal counts result in a draw. Both players play optimally to minimize the number of monkeys they collect. Find the numbers collected by Ishigami and Iino at the end of the game.
The input is given in the following format:
Print the numbers of monkeys collected by Ishigami and Iino, in this order, separated by a space.