9 5 14
7 1 4 8 5 2 6 9 3
2 8
1 6
5 7
1 3
3 9
1 5
1 8
1 5
1 4
1 8
1 3
1 5
1 5
1 7
1 7
2 3
1 2
1 1
1 2
 6 5 8
1 2 6 3 4 5
2 4
1 3
1 6
3 5
2 5
1 1
1 4
1 1
2 1
2 5
2 2
2 3
1 4
 2 1 3
1 2
1 2
1 1
1 1
1 1

6
9
5
8
1
7
0
0
0
0
0
4
0
 6
5
4
3
 2
1
0

/**
 *    author:  tourist
 *    created: 09.05.1945 00:43:00
**/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define fi first
#define se second
#define pb emplace_back
#define all(x) x.begin(),x.end()
#define re return
#define mp make_pair
#define sz(x) ((int)(x).size())
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define unq(x) (x.resize(unique(all(x)) - x.begin()))
#define sqr(x) ((x)*(x))
#define int long long

using namespace std;
using namespace __gnu_pbds;

typedef tree <int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef pair<double, double> pdd;
typedef double D;

double getTime() { return clock() / (double) CLOCKS_PER_SEC;};

const int mod = 1e9 + 7;
const ll INF = 3e18;
const int N = 2e5 + 5;
const int P0 = 437;
const int P1 = 343;
const int d = 400;

vi start(N), was(N), pa(N), Sz(N);
vii v[N];
int timer = 1;
set <int> group[N];
vi st_g[N];

void Make(int i)
{
    pa[i] = i;
    Sz[i] = 1;
}

int Find (int pos)
{
    if(pa[pos] != pos)
        pa[pos] = Find(pa[pos]);
    re pa[pos];
}

vi from, to;
vvi g;

vi lol;

void Union(int i, int j)
{
    int i_ind = Find(i), j_ind = Find(j);
    if(i_ind == j_ind)
    {
        from.pb(-1);
        to.pb(-1);
        g.pb(lol);
        re;
    }
    if(Sz[i_ind] <= Sz[j_ind])
    {
        pa[i_ind] = j_ind;
        Sz[j_ind] += Sz[i_ind];
        from.pb(j_ind);
        to.pb(i_ind);
        g.pb(st_g[i_ind]);
        for (int x : st_g[i_ind])
            st_g[j_ind].pb(x);
    }
    else
    {
        pa[j_ind] = i_ind;
        Sz[i_ind] += Sz[j_ind];
        from.pb(i_ind);
        to.pb(j_ind);
        g.pb(st_g[j_ind]);
        for (int x : st_g[j_ind])
            st_g[i_ind].pb(x);
    }
}

void dfs (int pos)
{
    was[pos] = timer;
    Sz[timer]++;
    for (auto u : v[pos])
    {
        int x = u.fi, i = u.se;
        if(!was[x] && start[i])
            dfs(x);
    }
}

void solve()
{
    int n, m, k;
    cin >> n >> m >> k;
    vi p(n);
    rep(i, n)
        cin >> p[i];
    vi L(m), R(m);
    start.resize(n);
    rep(i, m)
    {
        start[i] = 1;
        int l, r;
        cin >> l >> r;
        l--; r--;
        L[i] = l; R[i] = r;
        v[l].pb(r, i);
        v[r].pb(l, i);
    }
    vi t(k), a(k);
    rep(i, k)
    {
        cin >> t[i] >> a[i];
        a[i]--;
        if(t[i] == 2)
            start[a[i]] = 0;
    }
    rep(i, n)
    {
        if(!was[i])
        {
            dfs(i);
            timer++;
        }
//        cout << was[i] << ' ';
    }
//    cout << '\n';
    vi Was(n + 1, -1);
    rep(i, n)
    {
        if(Was[was[i]] == -1)
        {
            Was[was[i]] = i;
            Make(i);
            st_g[i].pb(i);
        }
        else
        {
            Make(i);
            st_g[i].pb(i);
            Union(Was[was[i]], i);
        }
    }

    from.clear();
    to.clear();
    g.clear();

    rrep(i, k)
    {
        if(t[i] == 1)
            continue;
        Union(L[a[i]], R[a[i]]);
    }

    reverse(all(from));
    reverse(all(to));
    reverse(all(g));

    vi now(n);

    rep(i, n)
    {
        int ind = Find(i);
        group[ind].insert(p[i]);
        now[i] = ind;
//        cout << now[i] << ' ';
    }

    int pos = 0;

    rep(i, k)
    {
        if(t[i] == 1)
        {
            auto it = group[now[a[i]]].end();
            it--;
            cout << *it << '\n';
            group[now[a[i]]].erase(it);
            group[now[a[i]]].insert(0);
        }
        else
        {
            if(from[pos] != -1)
                for (int x : g[pos])
                {
                    if(group[from[pos]].find(p[x]) != group[from[x]].end())
                        group[to[pos]].insert(p[x]);
                    else
                        group[to[pos]].insert(0);
                    group[from[pos]].erase(p[x]);
                    now[x] = to[pos];
                }
            pos++;
        }
    }
    re;

}

signed main()
{
    //freopen("input.txt ", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int qq = 1;
//    cin >> qq;
    while(qq--)
        solve();
}

