Autumn has come — which means everyone starts thinking about how quickly summer flew by...
It seems that a lot happened over these three months — but at the same time, it feels like there could have been even more.
This time you prepared thoroughly — and documented all your activities, dividing them into four categories:
You are interested in the total time spent on each of the four categories of activities.
The first line contains an integer $$$N$$$ ($$$1 \le N \le 2 \cdot 10^5$$$) — the number of records in the log.
Each of the next $$$N$$$ lines contains one log record in the format $$$D$$$ $$$A$$$ (two strings separated by a space), where:
It is guaranteed that:
Note — consecutive records may contain the same activities.
Output $$$4$$$ lines, each containing the total time spent on the corresponding activity type.
The order of the output lines is S, W, T, R (sleep; study / work; time on the road; entertainment, respectively).
Each line must be printed in the format DD hh:mm:ss — the number of days, hours, minutes, and seconds spent on that activity type over the whole summer.
Assume that summer ends exactly at 09.01 00:00:00 (that is, the last activity in the log continues until that moment).
1006.01 00:00:00 S06.01 09:12:34 W06.02 00:59:47 S06.02 08:00:00 W07.16 07:45:00 T07.16 12:58:27 R08.01 20:21:53 R08.25 18:00:07 T08.25 23:57:59 S08.26 08:00:00 W
S 1 00:14:48 W 50 07:32:13 T 0 11:11:19 R 40 05:01:40
206.01 00:00:00 T08.29 09:12:34 W
S 0 00:00:00 W 2 14:47:26 T 89 09:12:34 R 0 00:00:00
Example 1.
Let us consider the given log step by step:
Example 2.
Let us consider the given log step by step:
Note that although there are no records of type S and R in the log — you still need to output the total time for them as well (in this case it will be zero, that is, 00 00:00:00).
| Name |
|---|


