#ABC475B. 找零 / Change

找零 / Change

Problem Statement

In the Kingdom of AtCoder, three kinds of coins — 11-yen coins, 1010-yen coins, and 100100-yen coins — and 10001000-yen bills are in circulation.

Takahashi made NN purchases, starting from a state where he had 1010010^{100} 10001000-yen bills and 00 coins.

In the ii-th purchase, he bought an item worth AiA_i yen. For the payment, he paid using only the minimum number of 10001000-yen bills such that the total amount paid was at least AiA_i yen, and received the change so that the total number of coins received as change was minimized.

Find the number of each type of coin that Takahashi has at the point when all NN purchases are finished.

Constraints

  • 1≤N≤10001\leq N \leq 1000
  • 1≤Ai≤1051\leq A_i \leq 10^5
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

  • NN
  • A1A_1 A2A_2 …\dots ANA_N

Output

Output the number of 11-yen coins, 1010-yen coins, and 100100-yen coins that Takahashi has at the point when the NN purchases are finished, in this order, separated by spaces.

3
1296 110 1
13 18 24

In the first purchase, for the payment of 12961296 yen, Takahashi pays with two 10001000-yen bills, and receives seven 100100-yen coins and four 11-yen coins as change.

In the second purchase, for the payment of 110110 yen, he pays with one 10001000-yen bill, and receives eight 100100-yen coins and nine 1010-yen coins as change.

In the third purchase, for the payment of 11 yen, he pays with one 10001000-yen bill, and receives nine 100100-yen coins, nine 1010-yen coins, and nine 11-yen coins as change.

At the point when the three purchases are finished, he has 1313 11-yen coins, 1818 1010-yen coins, and 2424 100100-yen coins.

12
3141 592 65358 9 79 323 84 6264 3 38327 950 28
52 59 82