Bugcat is playing a game. The game provides an undirected graph where each node contains a monster. A monster may also have zero or one minion. A node is considered unlocked only after you defeat all enemies (including the minion, if it exists) at that node. You can move to a node if and only if it is connected to at least one already unlocked node.
However, you do not necessarily need to defeat all enemies when you visit a node. Specifically, you may choose to defeat only the monster's minion and then leave for other nodes. In this case, the node remains locked.
The player starts with an initial HP $$$x$$$. When attempting to kill an enemy with HP $$$y$$$, if $$$x \ge y$$$, the enemy is defeated and the player's HP increases by $$$y$$$ (i.e., $$$x \leftarrow x + y$$$). Otherwise, the player dies immediately.
Maomaochong asks for your help. He provides the undirected graph and the initial HP of the monster at each node (initially, no monsters have minions). There are multiple operations of two types:
The first line contains three integers $$$n, m, q$$$ ($$$1 \le n, m, q \le 2 \times 10^5$$$), representing the number of nodes, edges, and queries.
The second line contains $$$n$$$ integers representing the health of the monster at each node $$$h_i$$$ ($$$1 \le h_i \le 10^6$$$).
The next $$$m$$$ lines each contain two integers $$$x, y$$$ representing an undirected edge between node $$$x$$$ and $$$y$$$. There are no self-loops or multiple edges.
The next $$$q$$$ lines start with an operation type $$$op$$$:
For each Query, output a single integer representing the maximum possible final health.
5 5 51 2 6 6 81 21 31 44 53 52 2 21 3 22 2 21 4 52 4 4
5 27 4
| Название |
|---|


