- 84

## Statement

## Goal

You must crank an`W`x

`H`matrix counterclockwise by

`X`positions. To crank a matrix, you must shift each matrix element along the matrix rectangle. For example, for a 7x5 matrix with

`X`= 1 the movements are performed this way:

v < < < < < <

v v < < < < ^

v v 0 0 0 ^ ^

v > > > > ^ ^

> > > > > > ^

where the characters < ^ > v represent the displacement of a value in that position; 0 means no displacement.

Input

**Line 1:**2 integers

`W`and

`H`representing the width and height (respectively) of a matrix.

**Line 2:**An integer

`X`representing the number of positions to crank the matrix.

**Next**

`H`lines:`W`matrix values

`v`per line.

Output

**The cranked matrix.**

`H`lines:Constraints

1 ≤

1 ≤

-100 ≤

`W`,`H`≤ 501 ≤

`X`≤ 100000000-100 ≤

`v`≤ 100Example

Input

3 3 1 1 2 3 4 5 6 7 8 9

Output

2 3 6 1 5 9 4 7 8

A higher resolution is required to access the IDE

Online Participants

### Channels

### Direct Messages

No private conversations