A binary clock displays a time by writing each part of the time in binary. This problem uses two common layouts.
In the 3-column layout, there are 6 rows and 3 columns. From left to right, the columns represent hour, minute, and second. From top to bottom, the rows represent the values 2^5, 2^4, ..., 2^0.
In the 3-row layout, there are 3 rows and 6 columns. From top to bottom, the rows represent hour, minute, and second. From left to right, the columns represent the values 2^5, 2^4, ..., 2^0.
Both layouts are read in row-major order, from left to right within each row and from top row to bottom row.
For the time 10:37:49, the 3-column layout is read as 011001100010100011, and the 3-row layout is read as 001010100101110001.
You are given valid times in HH:MM:SS form. For each time, print how it is read in the binary clock's 3-column layout and 3-row layout.
The first line contains the number of test cases N (1 <= N <= 1000).
Each of the next N lines contains one time in decimal notation, written as hour, minute, and second in HH:MM:SS form.
For each test case, print two strings separated by one space: the time read in the 3-column layout, then the time read in the 3-row layout.
Each string must contain exactly 18 bits.