Dining Time

Time Limit: 1 Second    Memory Limit: 32768 KB

In my high school, there are two shopwindows owned by different bosses in the dining room. They all do themselves best to get more income. And I, a really curious student, want to know which of them do a better job. So I investigated it and get a report of every student in my school. What a hard work! But if you help me find out the conclusion, it is worthy. Now, I will discribe the situation of the dining room and details about the report, so you can help me easily.

Situation of dining room:

The two shopwindows begin to sell foods at time 0.

In front of each shopwindow, there are two fences beside the queue to avoid anybody jumping in. So you can move to the other queue's end if and only if you are at the end of this queue and not in service right now. (assume moving from one queue to another will take no time, and they always move faster than the student just arrive at the same time to choose a shopwindow).

Details about the report:

The first line of the report are two positive integers t1 and t2.

ti is the time of ith shopwindow sold one piece of food.

(So the time of service of one student to buy n pieces of food is n*ti ).

There are no more than 1000 lines followed, each describes one student.

Each line contain three integers t , p, ch.

t is the time the student arrive at dining room, which might be minus representing that he(or she) can arrived before the dinning time.

p is the number of pieces of food the student want to buy, it is positive;

ch describes how much he/she prefer to the first shopwindow.

Here we assume the length of queue of the ith shopwindow is Len(i), it means that,

when he/she can choose which shopwindow to buy foods(when the student arrive at the dining room or when he/she is at the end of the queue and not in service),

if he/she finds that (Len1 - Len2 <= ch) , he/she will choose the first shopwindow, otherwise, he/she will choose the second.

(e.x. Assume the queue length of the second shopwindow is 10, ch = -1, so if the queue length of the first shopwindow is less than or equal to 9, this student will choose the first window.)

This lines is in ascending order of t (the students arrive in order, if two students arrive at the same time, your may assume the student in the previous order arrives a litter earlier.), and ended by a line contain the negative p, and this line is not regarded as a student.

Your task:

You should compute two integer tp1, tp2 . tp(i) is the total pieces of food the ith shopwindow has sold.

Input

There are several reports like above.

Output

For each report, the first line of output is "Report i:", i is the number of report, start by 1.

The second line should output two integer tp1 and tp2, separated by one space.

The third line is blank.

Check them in Samples.

Sample Input

1 1
0 1 1
0 1 1
0 1 1
0 -1 2
1 1
0 1 2
0 4 0
0 7 -1 
1 1 -1
0 -1 2

Sample Output

Report 1:
2 1

Report 2:
8 5
Submit

Source: ZOJ Monthly, February 2004