You have a table of integer numbers. You should rotate rows of the table by the specified distance.
Try to use collections and standard methods for them.
Input data format
The first line contains two numbers: a number of rows and a number of columns of the table.
The following lines describe rows of the table. In each row, all elements are separated by spaces.
The last line consists of one number, which is the distance for rotating.
Output data format
Output the resulting table. Separate numbers by a single space in the output.