B. Beza's Hangover
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Friday nights are tricky for UFPE's ICPC competitors - they must be careful with their plans, after all, they train on saturdays and must be in good shape to help their team. Beza, however, went to a party on his friday night and said that no booze could bring him down. He was wrong.

Beza's night had $$$N$$$ hours, the party's bar had $$$M$$$ distinct beverages and, at each of the $$$N$$$ hours, Beza went to the bar and got one of the $$$M$$$ drinks. Lucas, who is an experienced drinker, said that a competitor would not be hungover the next day if the total volume of alcohol he drank did not exceed half the number of minutes he spent drinking.

Saturday morning, Beza woke up and noticed he was terribly hungover, and this made him think about the things he did on that night. Since Beza has got a nasty headache, he's not able to think clearly, and, therefore, asks you to help him answer some questions he has about that night.

Beza's questions can be of two types:

  • $$$1$$$ $$$X$$$ $$$Y$$$ - he wonders if it would be a good idea to drink $$$Y$$$ at the $$$X$$$-th hour. Therefore, he changes the beverage of the $$$X$$$-th hour to $$$Y$$$. It is guaranteed that the beverage $$$Y$$$ was available at the bar. ($$$1 \le X \le N$$$)
  • $$$2$$$ $$$L$$$ $$$R$$$ - he asks himself if he would be hungover on saturday, if his night only consisted of drinking from the $$$L$$$-th to the $$$R$$$-th hour, given his night's "drink schedule" at the moment of this query. ($$$1 \le L \le R \le N$$$)
Input

The first line of input consists of three integers $$$N$$$, $$$M$$$, and $$$Q$$$, ($$$1 \le N, M, Q \le 2 \cdot 10^{5}$$$). The next line contains $$$N$$$ strings $$$D_i$$$, $$$1 \le \vert D_i \vert \le 20$$$, each one describing the name of the $$$i$$$-th drink Beza had that night. Then, $$$M$$$ lines follow, each one containing two entries $$$S$$$ and $$$V$$$, $$$1 \le \vert S \vert \le 20$$$, $$$1 \le V \le 100$$$, which describe, respectively, the name of a drink the bar had and how many liters of alcohol it had. Finally, $$$Q$$$ lines follow, each one containing three integers, as described on the problem's statement.

Output

For all queries of type $$$2$$$, you must answer "YES" if Beza would be hungover the next day, given the interval of hours on which he would be drinking, and "NO" otherwise. It is guaranteed that there will be at least one query of type $$$2$$$.

Example
Input
6 6 5
vodka pitu beats whisky vodka cuba
vodka 30
caipirinha 10
pitu 35
beats 15
whisky 20
cuba 50
2 3 4
1 3 cuba
2 3 3
1 5 cuba
2 1 5
Output
NO
YES
YES
Note

The total amount of hours passed by on a given interval $$$[L, R]$$$ is $$$R - L + 1$$$.