Input
The first line of the input contains the number of columns and rows of each partial small image.
The second line represents the total amount of partial small images to be joined sequentially.
Then the following lines will represent each of the small images.
Output
The output is the final image formed by the concatenation of the partial small images.
Input
2 3 4 00 01 00 11 00 11 11 00 11 00 10 00
Output
00111100 01000010 00111100
Input
2 2 5 XX XX YY YY ZZ ZZ 00 00 11 11
Output
XXYYZZ0011 XXYYZZ0011