An old Measharan proverb says that a good day must include a reference to hexagons. Ronald Zynoulus has received his prize from Gill Bytes, in a huge amount of coins. Thus, he has started to arrange them in hexagonal patterns on his game board. He called a number hexagonal iff there is a regular hexagon on a hex grid which contains exactly hexes. Thus, the first four hexagonal numbers are: 1, 7, 19, 37.
* * * *
* * * * * * * *
* * * * * * * * * * * *
* * * * * * * * * * * * * * * *
* * * * * * * * * * * *
* * * * * * * *
* * * *
Ronald wants to use all of his coins to build such hexagons. Each non-negative integer can be written as a sum of hexagonal numbers, for example, . Of course, he would like to use as few hexagons as possible. He called the smallest number of hexagonal components of the hyperhexagonality of .
Your task is to calculate the hyperhexagonality of the given number.
Input consists of cases (). Each case is a single number , . The input ends with 0.
For each in the input, output its hyperhexagonality.
Input
1 6 7 19 27 0
Output
1 6 1 1 3