Itzel is very excited because her friend group organized a "ladies brunch" at the new aesthetic restaurant in town: La Cafetería Orgánica De Especialidad: Frappés, Éclairs y Matcha (CODEFEM). She woke up at 9:00, had breakfast at 10:00, went to the gym until 12:00, got ready, and arrived on time at 15:00.
Itzel and her friends sit around a circular table in clockwise order, where Itzel occupies position $$$0$$$ and her friends occupy positions $$$1, 2, \dots, N-1$$$.
The cafe has a menu consisting of $$$M$$$ products with fixed integer prices. As the afternoon progresses, they start ordering drinks and desserts. Seeing that the waitress is overwhelmed by the high volume of orders and is having trouble keeping track of everyone's bill, Itzel decides to write a program to process the orders.
There are $$$Q$$$ operations of three types:
Help Itzel process all operations and output the answers to all queries.
The first line contains two integers $$$N$$$ and $$$M$$$ ($$$1 \le N \le 100000$$$, $$$1 \le M \le 10000$$$), the number of people at the table and the number of menu products.
The second line contains $$$N$$$ space-separated strings: the names of the people seated in clockwise order (the first person is Itzel at position $$$0$$$).
The next $$$M$$$ lines each contain a string $$$ProductName$$$ and an integer $$$P$$$ ($$$1 \le P \le 10^9$$$), representing the product name and its price.
All person names are distinct, and all product names are distinct. Every name consists of between $$$1$$$ and $$$20$$$ characters without spaces. The total length of all strings in the input does not exceed $$$10^6$$$.
The next line contains an integer $$$Q$$$ ($$$1 \le Q \le 100000$$$), the number of operations.
The next $$$Q$$$ lines describe the operations in the format specified above.
For each operation of type 3, print a single integer on a new line: the total accumulated bill of the queried person.
4 3Itzel Celi Emily SofiaMatchaLatte 85Eclair 60TaroFrappe 9551 Itzel MatchaLatte2 2 0 Eclair3 Itzel3 Celi3 Emily
145 0 60
| Name |
|---|


