// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <iomanip>
#define dibs reserve
#define OVER9000 1234567890
#define patkan 9
#define tisic 47
#define soclose 1e-9
#define pi 3.1415926535898
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define chocolate win
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):(x))
#define uint unsigned int
// mylittlepony
using namespace std;
int main() {
cin.sync_with_stdio(0);
int N;
cin >> N;
set< pair<int,int> > S;
set<int> X,Y;
vector<int> maxY(50000+tisic,0);
for(int i =0; i < N; i++) {
int x,y;
cin >> x >> y;
maxY[x] =max(maxY[x],y);
S.insert(make_pair(x,y));
X.insert(x);
Y.insert(y);}
ALL_THE(X,it) ALL_THE(Y,jt)
if(S.find(make_pair(*it,*jt)) == S.end() && maxY[*it] > *jt)
cout << *it << " " << *jt << "\n";
return 0;}
// look at my code
// my code is amazing
Ly8gaW9zdHJlYW0gaXMgdG9vIG1haW5zdHJlYW0KI2luY2x1ZGUgPGNzdGRpbz4KLy8gYml0Y2ggcGxlYXNlCiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPHNldD4KI2luY2x1ZGUgPG1hcD4KI2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPHF1ZXVlPgojaW5jbHVkZSA8c3RhY2s+CiNpbmNsdWRlIDxhbGdvcml0aG0+CiNpbmNsdWRlIDxjbWF0aD4KI2luY2x1ZGUgPGlvbWFuaXA+CiNkZWZpbmUgZGlicyByZXNlcnZlCiNkZWZpbmUgT1ZFUjkwMDAgMTIzNDU2Nzg5MAojZGVmaW5lIHBhdGthbiA5CiNkZWZpbmUgdGlzaWMgNDcKI2RlZmluZSBzb2Nsb3NlIDFlLTkKI2RlZmluZSBwaSAzLjE0MTU5MjY1MzU4OTgKI2RlZmluZSBBTExfVEhFKENBS0UsTElFKSBmb3IoYXV0byBMSUUgPUNBS0UuYmVnaW4oKTsgTElFICE9IENBS0UuZW5kKCk7IExJRSsrKQojZGVmaW5lIGNob2NvbGF0ZSB3aW4KI2RlZmluZSBmZiBmaXJzdAojZGVmaW5lIHNzIHNlY29uZAojZGVmaW5lIGFicyh4KSAoKHggPCAwKT8tKHgpOih4KSkKI2RlZmluZSB1aW50IHVuc2lnbmVkIGludAovLyBteWxpdHRsZXBvbnkKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKIAppbnQgbWFpbigpIHsKICAgIGNpbi5zeW5jX3dpdGhfc3RkaW8oMCk7CiAgICBpbnQgTjsKICAgIGNpbiA+PiBOOwogICAgc2V0PCBwYWlyPGludCxpbnQ+ID4gUzsKICAgIHNldDxpbnQ+IFgsWTsKICAgIHZlY3RvcjxpbnQ+IG1heFkoNTAwMDArdGlzaWMsMCk7CiAgICBmb3IoaW50IGkgPTA7IGkgPCBOOyBpKyspIHsKICAgICAgICBpbnQgeCx5OwogICAgICAgIGNpbiA+PiB4ID4+IHk7CiAgICAgICAgbWF4WVt4XSA9bWF4KG1heFlbeF0seSk7CiAgICAgICAgUy5pbnNlcnQobWFrZV9wYWlyKHgseSkpOwogICAgICAgIFguaW5zZXJ0KHgpOwogICAgICAgIFkuaW5zZXJ0KHkpO30KIAogICAgQUxMX1RIRShYLGl0KSBBTExfVEhFKFksanQpCiAgICAgICAgaWYoUy5maW5kKG1ha2VfcGFpcigqaXQsKmp0KSkgPT0gUy5lbmQoKSAmJiBtYXhZWyppdF0gPiAqanQpCiAgICAgICAgICAgIGNvdXQgPDwgKml0IDw8ICIgIiA8PCAqanQgPDwgIlxuIjsKICAgIHJldHVybiAwO30KIAovLyBsb29rIGF0IG15IGNvZGUKLy8gbXkgY29kZSBpcyBhbWF6aW5n
prog.cpp: In function ‘int main()’:
prog.cpp:20:31: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
^
prog.cpp:44:5: note: in expansion of macro ‘ALL_THE’
ALL_THE(X,it) ALL_THE(Y,jt)
^
prog.cpp:44:15: error: ‘it’ does not name a type
ALL_THE(X,it) ALL_THE(Y,jt)
^
prog.cpp:20:36: note: in definition of macro ‘ALL_THE’
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
^
prog.cpp:44:15: error: expected ‘;’ before ‘it’
ALL_THE(X,it) ALL_THE(Y,jt)
^
prog.cpp:20:55: note: in definition of macro ‘ALL_THE’
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
^
prog.cpp:44:15: error: ‘it’ was not declared in this scope
ALL_THE(X,it) ALL_THE(Y,jt)
^
prog.cpp:20:55: note: in definition of macro ‘ALL_THE’
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
^
prog.cpp:20:31: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
^
prog.cpp:44:19: note: in expansion of macro ‘ALL_THE’
ALL_THE(X,it) ALL_THE(Y,jt)
^
prog.cpp:44:29: error: ‘jt’ does not name a type
ALL_THE(X,it) ALL_THE(Y,jt)
^
prog.cpp:20:36: note: in definition of macro ‘ALL_THE’
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
^
prog.cpp:44:29: error: expected ‘;’ before ‘jt’
ALL_THE(X,it) ALL_THE(Y,jt)
^
prog.cpp:20:55: note: in definition of macro ‘ALL_THE’
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
^
prog.cpp:44:29: error: ‘jt’ was not declared in this scope
ALL_THE(X,it) ALL_THE(Y,jt)
^
prog.cpp:20:55: note: in definition of macro ‘ALL_THE’
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
^