#include<iostream>
#include<fstream>
using namespace std;
ifstream fin("christmas.in");
ofstream fout("christmas.out");
int f[1001][1001]={0},l[1001]={0},t[1001]={0};
int n,sum=0,maxx=0;
int main()
{
fin>>n;
for (int i=1;i<=n*2;i++)
fin>>l[i]>>t[i];
for (int i=1;i<=n;i++)
for (int j=n+1;j<=n*2;j++)
f[i][j-n]=(l[i]-l[j])*(l[i]-l[j])+(t[i]-t[j])*(t[i]-t[j]);
for (int i=1;i<=n;i++)
{
int minn=1000000;
for (int j=1;j<=n;j++)
if (f[i][j]<minn)
minn=f[i][j];
if (minn>maxx)
maxx=minn;
}
for (int i=1;i<=n;i++)
{
int minn=1000000;
for (int j=1;j<=n;j++)
if (f[j][i]<minn)
minn=f[j][i];
if (minn>maxx)
maxx=minn;
}
fout<<maxx;
fin.close();
fout.close();
return 0;
}