Enzo is a big fan of the game Lemmings, and his favorite parts of the game are protecting the Lemmings from danger and when they build ramps to travel safely from one place to another.
Since Enzo finds Lemmings a bit outdated, he decided to create a futuristic version of the game. He named his game "Almeidings 3077" and made it in 2D, viewed from above.
In Almeidings 3077, there are several creatures — the Almeidings — that must travel from a starting point $$$(x_i, y_i)$$$ to an endpoint $$$(x_f, y_f)$$$ safely. To parallel the ramp-building mechanics of the original game, Enzo created the concept of Protective Shields. A Protective Shield is a structure built by the Almeidings that allows them to pass safely through dangerous areas.
Enzo defined the following rules for his game:
After deciding that the goal of the game is to make the Almeidings conquer the space, Enzo decided to simulate it with your help. He will ask you $$$Q$$$ queries, and each query can be one of two types:
Your task is to answer all type $$$2$$$ queries correctly.
The first line of input contains three integers $$$N$$$, $$$M$$$ $$$(1 \le N \cdot M \le 10^{6})$$$, the dimensions of the matrix representing the game, followed by $$$Q$$$ $$$(1 \le Q \le 2 \cdot 10^{5})$$$, the number of queries Enzo will make.
The next $$$Q$$$ lines represent the queries, which can be of two types:
For each query of type $$$2$$$, print a line containing "SIM" if the Almeiding can reach its goal or "NAO" if it can't.
3 3 31 2 22 2 1 2 32 1 1 3 3
SIM NAO
3 3 42 1 1 3 31 1 12 1 1 3 32 3 1 1 3
NAO NAO SIM