To prove that he is never late for class, Thirstarfish insists that he entered the classroom at $$$7{:}110$$$ for a class beginning at $$$8{:}00$$$. This inspires a "generalized time notation."
In generalized time notation, a time is written $$$A{:}B$$$, where $$$A,B$$$ are nonnegative integers.
We define two equivalence rules for generalized times:
A time $$$h{:}m$$$ is a "standard time" if and only if $$$0 \le h \lt 24$$$ and $$$0 \le m \lt 60$$$.
Given a generalized time, find the unique equivalent standard time.
The first line contains an integer $$$T$$$ ($$$1 \le T \le 10^5$$$), the number of test cases.
Each test case contains two integers $$$A,B$$$ ($$$0 \le A,B \le 10^9$$$), representing the generalized time $$$A{:}B$$$.
For each test case, output two integers $$$h,m$$$ representing the equivalent standard time $$$h{:}m$$$.
57 11025 300 023 59100 200
8 501 300 023 597 20
Sample 1 Explanation
In the first test case, $$$7{:}110 \to 8{:}50$$$ by rule 1, since $$$110=60+50$$$.
In the second test case, $$$25{:}30 \to 1{:}30$$$ by rule 2, since $$$25=24+1$$$.
In the third test case, $$$0{:}0$$$ is already a standard time.
| Name |
|---|


