#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
bool cmp(int x,int y)
{
return x<y;
}
vector<int> v;
int main()
{
int n;scanf("%d",&n);
while(n--)
{
int x,y;scanf("%d%d",&x,&y);
if(x==1) v.push_back(y);
else
{
if(v.empty())
{
printf("Empty\n");
continue;
}
sort(v.begin(),v.end(),cmp);
if(*(v.end()-1)<y)
{
printf("%d\n",*(v.end()-1));
v.erase(v.end()-1);
continue;
}
int pos=upper_bound(v.begin(),v.end(),y)-v.begin();
pos--;
if(pos==-1) pos=0;
printf("%d\n",v[pos]);
v.erase(v.begin()+pos);
}
}
return 0;
}