#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int top=0,t1,n;
int ans=0;
struct point
{
int dx,dy;
}p[120000],st[120000];
bool cmp(point x,point y)
{
if(x.dx!=y.dx) return x.dx<y.dx;
return x.dy<y.dy;
}
double area(point x,point y,point z)
{
point A,B;
A.dx=x.dx-y.dx; A.dy=x.dy-y.dy;
B.dx=z.dx-y.dx; B.dy=z.dy-y.dy;
return A.dx*B.dy-A.dy*B.dx;
}
int len(point x,point y)
{
return (x.dx-y.dx)*(x.dx-y.dx)+(x.dy-y.dy)*(x.dy-y.dy);
}
int main()
{
cin>>n;
for(int i=1;i<=n;i++) cin>>p[i].dx>>p[i].dy;
sort(p+1,p+n+1,cmp);
st[++top]=p[1]; st[++top]=p[2];
for(int i=3;i<=n;i++)
{
while(top>=2 && area(st[top-1],st[top],p[i])>=0) top--;
st[++top]=p[i];
}
st[++top]=p[n-1]; t1=top;
for(int i=n-2;i>=1;i--)
{
while(top>=t1 && area(st[top-1],st[top],p[i])>=0) top--;
st[++top]=p[i];
}
int j=1;
for(int i=1;i<top;i++)
{
while(abs(area(st[i],st[i+1],st[j]))<abs(area(st[i],st[i+1],st[j%(top-1)+1]))) j=j%(top-1)+1;
ans=max(ans,max(len(st[i],st[j]),len(st[i+1],st[j])));
}
printf("%d",ans);
return 0;
}