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

            #include<bits/stdc++.h>
            #include<ext/pb_ds/assoc_container.hpp>
            #include<ext/pb_ds/tree_policy.hpp>
            using namespace __gnu_pbds;
            using namespace std;
            # define ll long long
           # define int long long  //comment it out when MLE
            # define endl "\n"
            template <typename T>
            using ordered_set = tree<T, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>;

            #define gok ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
            //# define m 163577857
            # define mo 1000000009
            # define pi acos(-1)
            # define fi first
           # define se second
            # define pb push_back
            # define pii pair<int,int>
            #define REP(i,n) for (int i = 1; i <= n; i++)
            const ll mod =   1e9 + 7;
            //const int K = 2;
            //typedef vector<vector<int> > matrix;

    /*      int add(int a, int b,int mod) {
                a%=mod;
                b%=mod;
                a += b;
                if (a >= mod) a -= mod;
                if(a<0)
                {
                    a += mod;
                    a %= mod;
                }
                return a;
            }

            int mul(ll a, int b,int mod) {
                a%=mod;
                b%=mod;
                a *= b;
                a += mod;
                return a % mod;
            }
            int po(int a,int b,int mod)
            {
                if(b==0)
                    return 1;
                if(b%2==0)
                    return po(mul(a,a,mod),b/2,mod);
                return mul(a,po(mul(a,a,mod),(b-1)/2,mod),mod);
            }


            ll fact[200010];
            ll inv[200010];
            ll in[2000010];
            void fact0()
            {
                int i,j;
                fact[0]=1;
                for(i=1;i<=200005;i++)
                {
                    fact[i]=i*fact[i-1]%mod;
                }
                inv[0]=1;
                inv[1]=1;
                ll p=mod;
                for (i=2; i<=200005; i++)
                    inv[i] = (p - (p/i) * inv[p%i] % p) % p;

                for(i=2;i<=200005;i++)
                {
                    inv[i]*=inv[i-1];
                    inv[i]%=mod;
                }
                in[0]=in[1]=1;
                for(int i=2;i<=200005;i++)
                {
                    in[i] = inv[i]*fact[i-1];
                    in[i] %= mo;
                }
            }
            int help(int a,int b)
            {
               // cout<<a<<" "<<b<<endl;
                int an = fact[a];
                //cout<<an<<endl;
                an *= inv[b];
                an %= mod;
                an *= inv[a-b];
                an %= mod;
                return an;
            }
/*
          void random()
            {
              srand(time(0));
            for (int i = 0; i < n; i ++)
                perm[i] = i + 1;
            random_shuffle(perm, perm + n);
            }

int ncr(int a,int b)
{
    if(b>a)
        return 0;
    int tt = fact[a];
    tt %= mod;
    tt *= inv[a-b];
    tt %= mod;
    tt *= inv[b];
    tt %= mod;
    return tt;
}
*/
/*
struct tri{
    tri *arr[2];
};

tri *newNode()
{
    tri *temp = new tri;
    //temp->value = 0;
    temp->arr[0] = temp->arr[1] = NULL;
    return temp;
}
void insert(tri *root,int val)
{
    tri *temp = root;
    for (int i=32; i>=0; i--)
    {
        bool idx = ((val&(1ll<<i)));
       // cout<<idx<<" ";
        if(temp->arr[idx]==NULL)
        {
            temp->arr[idx] = newNode();
        }
        temp = temp->arr[idx];
    }
   //cout<<endl;
}
int qry(tri *root,int val)
{
    int an=0;
    tri *temp = root;
    for (int i=32; i>=0; i--)
    {
        if((val&(1LL<<i))>0)
        {
            if(temp->arr[0]!=NULL){
            temp = temp->arr[0];
            an += (1LL<<i);
           // cout<<(1ll<<i)<<" ";
            }
            else if(temp->arr[1]!=NULL)
                temp=temp->arr[1];
            else{

                break;
            }
        }
        else/
        {
          if(temp->arr[1]!=NULL){
            temp = temp->arr[1];
            an += (1LL<<i);
           // cout<<(1ll<<i)<<" ";

            }
            else if(temp->arr[0]!=NULL)
                temp=temp->arr[0];
            else{
                 break;
            }
        }
    }
    //cout<<endl;
    return an;
}
*/
int n,m,q;
vector<int> comp[1000005],ccp(1000005);
set<int> ss[1000005];
int pa[1000005];
vector<pii> vv,qq;
int a[200005];
bool vis[1000005]={false};
vector<int> re;
int dsu(int x)
{
    if(pa[x]==x)
        return x;
    return pa[x] = dsu(pa[x]);
}

void merg(int u,int v,vector<int> &vec)
{
    int p1 = dsu(u);
    int p2 = dsu(v);
    // cout<<p1<<" "<<p2<<endl<<endl;
    if(p1==p2)
        return ;

    if(comp[p1].size()>comp[p2].size())
    {
        for(auto ii:comp[p2]){
            pa[ii] = p1;
            comp[p1].pb(ii);

        }

        vec = comp[p2];
        comp[p2].clear();
        pa[p2] = p1;
    }
    else
    {
         for(auto ii:comp[p1]){
            comp[p2].pb(ii);
             pa[ii] = p2;
         }
         vec = comp[p1];
        comp[p1].clear();
        pa[p1] = p2;
    }

}
signed main(){
	gok

	cin>>n>>m>>q;
	for(int i=1;i<=n;i++){
        cin>>a[i];
     pa[i]=i;
     ccp[a[i]]=i;
	}
	for(int i=0;i<m;i++)
    {
       int x,y;
       cin>>x>>y;
       vv.pb({x,y});
    }

    for(int i=0;i<q;i++)
    {
        int x,y;
        cin>>x>>y;
        qq.pb({x,y});
        if(x==2)
           vis[y-1]=true;

    }

     for(int i=1;i<=n;i++)
     {
         pa[i]=i;
         comp[i].pb(i);
     }

    for(int i=0;i<vv.size();i++)
    {
        if(!vis[i])
        {
            vector<int> tt;
            merg(vv[i].fi,vv[i].se,tt);
        }
    }


   vector<vector<int>> q1(q+1);

   for(int i=qq.size()-1;i>=0;i--)
   {
       if(qq[i].fi==2 && vis[qq[i].se-1])
       {
           int id = qq[i].se - 1;
           int aa = vv[id].fi;
           int b = vv[id].se;
           merg(aa,b,q1[i]);
       }
   }

   for(int i=1;i<=n;i++)
   {
       if(i==pa[i])
       {
           assert(!comp[i].empty());
           for(int ii:comp[i])
           {
               ss[i].insert(a[ii]);
           }
       }
   }
   int np=n+1;
   for(int i=0;i<qq.size();i++)
   {
       int ty = qq[i].fi;
       int val = qq[i].se;
       if(ty==1)
       {

          int pp = pa[val];
         // cout<<pp<<"--"<<ss[pp].size()<<endl;
          if(ss[pp].empty())
            cout<<0<<endl;
          else{
          auto id = ss[pp].end();
          id--;
          a[ccp[*id]]=0;
          cout<<*id<<endl;
          ss[pp].erase(id);
          }
       }
       else
       {
           int pp = pa[val];//dsu(val); //TLE
           for(auto ii:q1[i])
           {
              // cout<<a[ii]<<"-- ";
               ss[pp].erase(a[ii]);
               pa[ii]=np;
               if(a[ii])
               ss[np].insert(a[ii]);
           }
           //cout<<endl;
           np++;

       }
   }

















  return 0;
}

































