#include<bits/stdc++.h>
using namespace std;
long long n,m,k,c[100005],a[100005],b[100005],d[100005],e[100005],t;
int main(){
freopen("Florr.in","r",stdin);
freopen("Florr.out","w",stdout);
cin>>n>>m>>k;
for (long long i=1;i<=n;i++){
cin>>c[i];
}
for (long long i=1;i<=m;i++){
cin>>a[i]>>b[i];
d[a[i]]=1;
}
long long s=k;
for (long long i=m;i>=1;i--){
if (k==0) break;
if (c[a[i]]<c[b[i]]&&d[b[i]]==0){
k--;
e[++t]=i;
d[a[i]]=0;
d[b[i]]=1;
}
}
cout<<s-k<<endl;
for (long long i=1;i<=t;i++){
cout<<e[i]<<endl;
}
return 0;
}