Alice and Bob's Matrix Game
Alice and Bob play a game with an n×m matrix of integers. On each turn:
- On Alice's turn, she chooses a row and increments every value in that row by 1
- On Bob's turn, he chooses a column and decrements every value in that column by 1
They alternate turns starting with Alice, and they play for exactly k turns total (so Alice gets ⌈k/2⌉ turns and Bob gets ⌊k/2⌋ turns). You must simulate this game and output the final state of the matrix.
Input
The first line contains three integers n, m, k (1 ≤ n, m ≤ 1000; 1 ≤ k ≤ 10^6) — the number of rows, columns, and total number of turns.
The next n lines contain the initial matrix: row i contains m space-separated integers a_{i,j} (-10^9 ≤ a_{i,j} ≤ 10^9).
The next k lines describe the moves: each line contains either:
R i— Alice chooses rowi(1-indexed)C j— Bob chooses columnj(1-indexed)
The moves are already in order, alternating between Alice and Bob, starting with Alice.
Output
Print the final n×m matrix after all k turns, one row per line, space-separated integers.
Notes
The matrix values may become negative and their absolute value may exceed 10^9 in the final output. Use 64-bit integers to avoid overflow.