#### Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

## Problem Description

Peanut has been eating a lot of bakkwa over the CNY break (unfortunately), so much so that he has turned it into a programming problem!

A bakkwa can be modelled as a rectangle, divided into *N* by *M* individual squares. Each individual grid square has a certain tastiness level *T _{i,j}*.

Gug is bored, so he decides to perform *Q* updates on Peanut's bakkwa. Each query consists of six integers, *A _{x}*,

*A*,

_{y}*B*,

_{x}*B*,

_{y}*S*and

_{x}*S*, which involves swapping the rectangle defined by the points (A

_{y}_{x}, A

_{y}) and (A

_{x}+ S

_{x}- 1, A

_{y}+ S

_{y}- 1) with the rectangle defined by (B

_{x}, B

_{y}) and (B

_{x}+ S

_{x}- 1, B

_{y}+ S

_{y}- 1).

Peanut wants to know, after all of Gug's updates, what the new tastiness grid *T* looks like.

## Input

The first line of input will contain three integers, *N*, *M* and *Q*.

The next *N* lines of input will contain *M* integers each, representing the initial grid *T*.

The next *Q* lines will contain six integers each, representing *A _{x}*,

*A*,

_{y}*B*,

_{x}*B*,

_{y}*S*and

_{x}*S*for each query.

_{y}## Output

The output should contain *N* lines with *M* integers each, representing the final grid *T*

## Limits

For all subtasks: 1 ≤ T_{i,j} ≤ 10^{9}, all queries will be 0-indexed, it is guaranteed that the two rectangles in a single query do not share an edge.

Subtask 1 (24%): 1 ≤ N, M ≤ 500, 1 ≤ Q ≤ 500.

Subtask 2 (27%): 1 ≤ N, M ≤ 1000, 1 ≤ Q ≤ 5000, S_{x} = S_{y}.

Subtask 3 (49%): 1 ≤ N, M ≤ 1000, 1 ≤ Q ≤ 5000.

Subtask 4 (0%): Sample Testcases.

## Sample Testcase 1

### Input

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

### Output

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

### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 24 | 20 | 1.5s | 256MB | Minimum |

2 | 27 | 21 | 1.5s | 256MB | Minimum |

3 | 49 | 62 | 1.5s | 256MB | Minimum |

4 | 0 | 1 | 1.5s | 256MB | Minimum |

### Judge Compile Command

g++ ans.cpp -o bakkwa -Wall -static -O2 -lm -m64 -s -w -std=gnu++14 -fmax-errors=512