time

Ever since they appeared humans have measured time in the most various of ways. They invented solar devices, used water, sand, stones and G-d knows how many other innovations.
Let's imagine such a device that measures the flow of time by accumulating some balls in different boxes, the balls coming from a row where they are stored. Let's assume that the device has 3 boxes that measure a minute, five minutes and, respectively, an hour. The device is set to measure time between 01:00 AM and 12:59 AM (without indicating a.m or p.m). E.g. 3 balls in box 1-min, 3 balls in box 5-min and 3 balls in box ora, will represent 03:18.

Unfortunately this type of watch can't indicate a date, even though it can be deduced. In their movement balls change relative position in the row in a predictable manner, which can provide information about the time lapsed between two ball row configurations. More so, starting with a specific time configurations begin to repeat themselves.

The ball watch works in the following way:
every minute the first ball in the row is raised and stored in the box that indicates 1-min and which can contain up to 4 balls. When the fifth ball comes their weight makes the bottom of the box open up and the four balls fall back in the row of balls, at the end of the row; the ball that created this change moves forward all the way to the box indicating 5-min. This second box can contain up to 11 balls; the 12th ball determines the return of the 11 balls to the end of the row of balls and the 12th one's roll into the box marking hours. This third box can receive 11 balls but contains a ball from the beginning so that the hour indicated is numbered from 1 to 12. The 12th ball to enter in the 5-min box, after it causes the emptying of this box, rolls to the hour box and - capacity here being exceeded the box is emptied and the 12 balls go back to the end of the row of balls and the last ball remains in the box.

Task

Knowing the initial number of n balls used determine after how many days, at the beginning of the day, the first repetition of the initial configuration of balls, the one before the clock was started, appears. Initially the row of balls contains, in order, balls numbered from 1 to n-1 and the clock contains only one ball, ball number n, the ball located in the hour box.

Input Data
The program reads no input data.

Output Data
Output file 0-time.out will contain 101 lines, one line for each value from 27 to 127, value that represents the number of balls initially located in the row. The value on line 1 represents the number of days (24 hour time periods) after which the initial configuration of the 27 ball row reappears. The value on line 2 represents the number of days (24 hour time periods) after which the initial configuration of the 28 ball row reappears a.s.o, the value on line i represents the number of days (24 hour time periods) after which the initial configuration of the 26+i ball row appears.

You won't upload the problem solution on the website; you will upload the file 0-time.out containing the results.

Examples

0-time.out Explanations

6
...
60
...

On line 1: the initial configuration of the 27 balls reappears after 6 days
...

On line 4: the initial configuration of the 30 balls reappears after 60 days
...

Time limit - N/A.

Marinel Serban
Computer Science High School "Gr. C. Moisil" Iasi
marinel_serban@yahoo.com