#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
struct Point{
int x,y;
Point(int x=0,int y=0):x(x),y(y){}
};
typedef Point Vector;
bool cmp(const Point &p,const Point &q)
{
if(p.x!=q.x) return p.x<q.x;
return p.y<q.y;
}
Vector operator -(Point A,Point B){return Vector(A.x-B.x,A.y-B.y);}
Point p[50010],ch[50010];
int Cross(Vector A,Vector B){return A.x*B.y-A.y*B.x;}
int ConvexHull(Point *p,int n,Point *ch)
{
sort(p,p+n,cmp);
int m=0;
for(int i=0;i<n;i++){
while(m>1&&Cross(ch[m-1]-ch[m-2],p[i]-ch[m-2])<=0)m--;
ch[m++]=p[i];}
int k=m;
for(int i=n-2;i>=0;i--)
{
while(m>k&&Cross(ch[m-1]-ch[m-2],p[i]-ch[m-2])<=0)m--;
ch[m++]=p[i];
}
if(n>1)
m--;
return m;
}
int Dot(Vector A,Vector B){return A.x*B.x+A.y*B.y;}
int Length(Vector A){return Dot(A,A);}
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
for(int i=0;i<n;i++)
scanf("%d%d",&p[i].x,&p[i].y);
int x=ConvexHull(p,n,ch);
int ans=0;
for(int i=0;i<x-1;i++)
for(int j=i+1;j<x;j++)
if(Length(ch[i]-ch[j])>ans)
ans=Length(ch[i]-ch[j]);
printf("%d\n",ans);
}
return 0;
}