func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, m, q;   std::vector<int> val(500005);   std::map<int, pair<int, int> > edges;   std::vector<pair<int, int> > query(500005);   int vis[500005];   int par[500005];   set<pair<int, int> > ss[500005];   int sz[500005];   std::vector<pair<int, int> > changes[500005];   int st[500005], en[500005];   int getpar(int x) {     if (par[x] == x)       return x;     else       return getpar(par[x]);   }   void merge(int n1, int n2, int idx) {     int p1 = getpar(n1);     int p2 = getpar(n2);     if (p1 == p2) return;     if (sz[p1] > sz[p2]) swap(p1, p2);     sz[p2] += sz[p1];     sz[p1] = 0;     for (auto i : ss[p1]) {       ss[p2].insert(i);     }     par[p1] = p2;     if (idx != -1) {       st[idx] = p1;       en[idx] = p2;       for (auto i : ss[p1]) {         changes[idx].push_back(i);       }     }     ss[p1].clear();   }   int getans(int node) {     int pp = getpar(node);     pair<int, int> zz = *(ss[pp].rbegin());     cout << zz.first <<   n ;     auto it = ss[pp].rbegin();     ss[pp].erase(zz);     val[zz.second] = 0;     ss[pp].insert({val[zz.second], zz.second});     return zz.first;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n >> m >> q;     for (int i = 1; i < n + 1; i++) {       cin >> val[i];       sz[i] = 1;       par[i] = i;       ss[par[i]].insert({val[i], i});     }     for (int i = 1; i < m + 1; i++) {       int x, y;       cin >> x >> y;       edges[i] = {x, y};     }     for (int i = 1; i < q + 1; i++) {       cin >> query[i].first >> query[i].second;       if (query[i].first == 2) {         vis[query[i].second] = 1;       }     }     for (int i = 1; i < m + 1; i++) {       if (!vis[i]) {         merge(edges[i].first, edges[i].second, -1);       }     }     for (int i = q; i >= 1; i--) {       if (query[i].first == 2) {         merge(edges[query[i].second].first, edges[query[i].second].second, i);       }     }     for (int i = 1; i < q + 1; i++) {       if (query[i].first == 1) {         getans(query[i].second);       } else {         int st1 = st[i];         int en1 = en[i];         ss[st1].clear();         for (auto j : changes[i]) {           ss[st1].insert({val[j.second], j.second});           ss[en1].erase({val[j.second], j.second});         }         par[st1] = st1;       }     }   }   