A microwave oven has three timer buttons, A, B, and C. Each button is set to a fixed amount of time, and every press adds that time to the running time. Button A is set to 5 minutes, button B to 1 minute, and button C to 10 seconds.
Every frozen meal lists a cooking time T in seconds. You press the three buttons so that the added times sum to exactly T seconds. The total number of presses must always be as small as possible. This is called the minimum button operation.
If the cooking time is 100 seconds, press B once and C four times. Pressing C ten times also reaches 100 seconds, but ten presses is not the smallest count, so it cannot be the answer. Here B once plus C four times, five presses in total, is the minimum button operation. There are also cases such as T=234 where the three buttons cannot hit the time exactly.
Write a program that finds the minimum button operation for a given cooking time of T seconds.
The first line contains the cooking time T in seconds as an integer, with 1≤T≤10000.
On the first line, print how many times A, B, and C are pressed in the minimum button operation for T seconds, in that order. Separate the counts with single spaces. Print 0 for a button that is not pressed. If the three buttons cannot reach exactly T seconds, print -1 on the first line.