#include<iostream> #include<cstdio> #include<algorithm> using namespace std; const int MAXN=1001; struct a{ int x; int y; }; a arr_xy[MAXN]; bool Compare(a m,a n){ return m.x<n.x; } int main() { int n; while(scanf("%d",&n)!=EOF){ for(int i=0;i<n;++i){ scanf("%d",&arr_xy[i].x); scanf("%d",&arr_xy[i].y); } sort(arr_xy,arr_xy+n,Compare); int temp=arr_xy[0].y; for(int i=1;arr_xy[i].x==arr_xy[0].x;++i){ temp=arr_xy[i].y<temp?arr_xy[i].y:temp; } cout<<arr_xy[0].x<<" "<<temp<<endl; } return 0; }