

#include <iostream>
#include <queue>
using namespace std;
const int N = 2e5+10;
typedef long long ll;
ll a[N];
priority_queue <int> heap;
ll n,m,k;
int main()
{
cin >> n >> m >> k;
//第k小,也就是从小到大第k个数
//我们只需要维护前k个数就行了
for(int i = 1;i<=n;i++)
{
cin >> a[i];
heap.push(a[i]);
if(heap.size()>k)
{
heap.pop();//维护前k个数,把其他大的数删除
}
}
while(m--)
{
int op;cin >> op;
if(op == 1)
{
int x;cin >> x;
heap.push(x);
if(heap.size() > k)
{
heap.pop();
}
}
else{
if(heap.size()<k)cout << -1 << endl;
else
cout << heap.top() << endl;
}
}
return 0;
}