#0001CF

z-ioi2

IOI organizers decided to introduce some new things to the practice session.

The practice session will have 6 problems, each worth 100 points. The organizers have developed a software that does the following things:

- Reports when some competitor logs into the system.
- When a competitor submits a problem, it grades it and reports the score.

Now, you have to implement a system that monitors this software and reports in real time how many of each medals would be assigned based on the current results.

Since the competitors do not have to attend the practice session, you should report the medal assignments based on the number of people that have logged into the system at least once.

Also, for each competitor and each problem, you should use the score of the last submission for that problem.

You have to update the assignments every time someone logs in, or submits a problem.

The rules for assigning the medals are the following:
- No more than 1/6 of the competitors will get a gold medal
- No more than 1/4 of the competitors will receive gold or silver medal
- No more than 1/2 of the competitors will receive a gold, solver or bronze medal.
- Two competitors with the same score must both receive the same medal, or no medal.
- The difference between the lowest gold score and highest silver score, the difference between the lowest silver score and the highest bronze score, as well as the difference between the lowest bronze score and the highest non-medal score must be at least 2 points
- The difference between the the lowest gold score and the highest bronze score, as well as the difference between the lowest silver score and the highest non-medal score must be at least 3 points.
- The difference between the lowest gold score and the highest non-medal score must be at least 4 points.




InputThis is an interactive problem.

You should repeat the following:
Read a command from the standard input. The commands can be one of the following:
- login [id] meaning that user with id has just logged into the system. id will be an integer between 1 and 2000000, and will uniquely represent an user.
- submission [id] [task] [score] meaning that user with id has submitted a solution for the task, and received score. task will be in the range [1 6], and score will be in the range [0 100]. It is guaranteed that the user id has logged in before.
- done This command means that there is no more commands to be issued, and you can stop executing your program.

There will be no more than 50000 commands.

After each of the first two commands you should output (in one line) three integers, separated by space, representing the number of gold, silver and bronze medalists. Such that the number of gold, silver and bronze medalists is maximized (in that order) while satisfying the constrains.


You read: login 1
You write: 0 0 0
You read: login 2
You write: 0 0 0
You read: login 3
You write: 0 0 0
You read: submission 1 1 100
You write: 0 0 1
You read: login 4
You write: 0 1 0
You read: login 5
You write: 0 1 0
You read: login 6
You write: 1 0 0
You read: done


You read: login 1
You write: 0 0 0
You read: login 2
You write: 0 0 0
You read: login 3
You write: 0 0 0
You read: login 4
You write: 0 0 0
You read: login 14
You write: 0 0 0
You read: login 15
You write: 0 0 0
You read: login 12
You write: 0 0 0
You read: login 16
You write: 0 0 0
You read: submission 1 1 100
You write: 1 0 0
You read: submission 2 2 100
You write: 0 2 0
You read: submission 1 2 50
You write: 1 1 0
You read: submission 1 1 50
You write: 0 2 0
You read: submission 3 1 50
You write: 0 2 1
You read: submission 1 2 25
You write: 1 1 1
You read: done

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.