#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
int a,d,c, a1=0,d1=0,c1=0, a2=0,d2=0,c2=0;
cin>>n;
for (int i=1;i<=n;i++)
{
cin>>a>>d;
c=a*a + d*d;
if(c>c1)
{
c2=c1;a2=a1;d2=d1;
c1=c;a1=a;d1=d;
}
else if(c>c2) {c2=c;a2=a;d2=d;}
}
cout<< a2 << " "<<d2 << endl;
}