By Luciano Ribeiro, Inatel Brazil
Dâmi and Marcus like to create computer games. Recently they created a game based in arrays, and now they need your help to test it.
It's given to you a bidimensional array M, which are initially filled with zeros. Then will be given Q operations. They are:
After they have created the game, now they want you to help them verify if their code is correct.
Each test case will begin with an integer Q (Q ≤ 100 000). After this you must read Q operations in the format described above (1 ≤ X ≤ Z ≤ 500 e 1 ≤ Y ≤ W ≤ 500 e |V| ≤ 5000).
For each operation of type "A", print the corresponding value as shown in the output sample.
Input Sample | Output Sample |
6 |
2 |