J. Time Trouble 2
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

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:

  1. For any $$$B \ge 60$$$, $$$A{:}B$$$ and $$$(A+1){:}(B-60)$$$ represent the same instant.
  2. For any $$$A \ge 24$$$, $$$A{:}B$$$ and $$$(A-24){:}B$$$ represent the same instant.

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.

Input

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$$$.

Output

For each test case, output two integers $$$h,m$$$ representing the equivalent standard time $$$h{:}m$$$.

Example
Input
5
7 110
25 30
0 0
23 59
100 200
Output
8 50
1 30
0 0
23 59
7 20
Note

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.