#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int N;
cin >>N;
priority_queue<pair<int,int>> pq;
int a,b;
for(int i=0;i<N;i++){
cin >>a>>b;
pq.push({a,b});
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCWlvczo6c3luY193aXRoX3N0ZGlvKDApOwogICAgY2luLnRpZSgwKTsgY291dC50aWUoMCk7CglpbnQgTjsKCWNpbiA+Pk47Cglwcmlvcml0eV9xdWV1ZTxwYWlyPGludCxpbnQ+PiBwcTsKCWludCBhLGI7Cglmb3IoaW50IGk9MDtpPE47aSsrKXsKCQljaW4gPj5hPj5iOwoJCXBxLnB1c2goe2EsYn0pOwoJfQp9