#K81412. String to 4x4 Matrix Conversion

    ID: 35748 Type: Default 1000ms 256MiB

String to 4x4 Matrix Conversion

String to 4x4 Matrix Conversion

You are given a string s consisting of exactly 16 characters. The string is composed of digits (0-9) and uppercase letters (A-Z). Your task is to convert this 16-character string into a 4x4 matrix by splitting it into 4 equal parts. Each part represents a row in the matrix.

The output should print the matrix in a formatted way: each row is on a new line, and the characters in each row are separated by a single space.

More formally, if the input string is \(s\), then it should be segmented as:

[ \text{matrix} = \begin{bmatrix} s_0 & s_1 & s_2 & s_3\ s_4 & s_5 & s_6 & s_7\ s_8 & s_9 & s_{10} & s_{11}\ s_{12} & s_{13} & s_{14} & s_{15} \end{bmatrix} ]

Ensure that the input string has exactly 16 characters. If not, the program should report an error (this case is not expected in the contest inputs).

inputFormat

The input is read from standard input (stdin) as a single string of exactly 16 characters.

Example:

123456789ABCDE0F

outputFormat

The output is printed to standard output (stdout) as a 4x4 matrix. Each row of the matrix is printed on a new line, and the characters in a row are separated by a space.

Example output for the above input:

1 2 3 4
5 6 7 8
9 A B C
D E 0 F
## sample
123456789ABCDE0F
1 2 3 4

5 6 7 8 9 A B C D E 0 F

</p>