# 代码

/*
* @Author: wxyww
* @Date:   2019-06-13 07:45:59
*/
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<queue>
#include<vector>
#include<ctime>
using namespace std;
typedef long long ll;
#define int ll
const int N = 100100,INF = 1e9;
#define ls TR[rt].ch[0]
#define rs TR[rt].ch[1]
priority_queue<int,vector<int>,greater<int> >q;
ll x=0,f=1;char c=getchar();
while(c<'0'||c>'9') {
if(c=='-') f=-1;
c=getchar();
}
while(c>='0'&&c<='9') {
x=x*10+c-'0';
c=getchar();
}
return x*f;
}
int mul(int x) {
return x * x;
}
struct node {
int ch[2],d[2],mx[2],mn[2];
}TMP,TR[N],a[N];
int D;
bool cmp(const node &A,const node &B) {
return A.d[D] < B.d[D];
}
void up(int rt) {
for(int i = 0;i <= 1;++i) {
if(ls) TR[rt].mx[i] = max(TR[ls].mx[i],TR[rt].mx[i]),
TR[rt].mn[i] = min(TR[ls].mn[i],TR[rt].mn[i]);
if(rs) TR[rt].mx[i] = max(TR[rs].mx[i],TR[rt].mx[i]),
TR[rt].mn[i] = min(TR[rs].mn[i],TR[rt].mn[i]);
}
}
int build(int l,int r,int now) {
D = now;
int mid = (l + r) >> 1;
nth_element(a + l,a + mid,a + r + 1,cmp);
TR[mid] = a[mid];
for(int i = 0;i <= 1;++i) TR[mid].mx[i] = TR[mid].mn[i] = TR[mid].d[i];
int rt = mid;
if(l < mid) ls = build(l,mid - 1,now ^ 1);
if(r > mid) rs = build(mid + 1,r,now ^ 1);
up(mid);
return mid;
}
int dis(const node &A,const node &B) {
return mul(A.d[0] - B.d[0]) + mul(A.d[1] - B.d[1]);
}
int get(const node &A,const node &B) {
int ret = 0;
for(int i = 0;i <= 1;++i)
ret += mul(max(abs(A.d[i] - B.mx[i]),abs(A.d[i] - B.mn[i])));
return ret;
}
void query(int rt) {
int K = dis(TMP,TR[rt]);
if(K > q.top()) q.pop(),q.push(K);
int dl = -INF,dr = -INF;
if(ls) dl = get(TMP,TR[ls]);
if(rs) dr = get(TMP,TR[rs]);
if(dl > dr) {
if(dl > q.top()) query(ls);
if(dr > q.top()) query(rs);
}
if(dr > dl) {
if(dr > q.top()) query(rs);
if(dl > q.top()) query(ls);
}
}
int X[N],Y[N];
signed main() {
for(int i = 1;i <= n;++i) {