#include<bits/stdc++.h>
#define fi first
#define se second
#define ll long long
using namespace std;
const int MAXN = 1010;
pair<int, int> c[MAXN];
vector<pair<int, pair<int, int>>> edge;
int n;
struct DSU{
int parent[MAXN];
DSU(){
for (int i = 1; i <= n; i++){
parent[i] = i;
}
}
int find(int u){
if (parent[u] != u) return parent[u] = find(parent[u]);
return parent[u];
}
bool unite(int u, int v){
u = find(u);
v = find(v);
if (u == v) return false;
parent[u] = v;
return true;
}
};
int dist(pair<int, int> &a, pair<int, int> &b){
return (a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second);
}
int main(){
freopen("moocast.in", "r", stdin);
freopen("moocast.out", "w", stdout);
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for (int i = 1; i <= n; i++){
cin >> c[i].first >> c[i].second;
}
for (int i = 1; i <= n; i++){
for (int j = i + 1; j <= n; j++){
edge.push_back({dist(c[i], c[j]), {i, j}});
}
}
sort(edge.begin(), edge.end());
DSU s;
int cnt = 0;
int ans = 0;
for (auto e: edge){
int w = e.fi;
int u = e.se.fi;
int v = e.se.se;
if (s.unite(u, v)){
ans = max(ans, w);
cnt++;
}
if (cnt == n - 1){
break;
}
}
cout << ans << '\n';
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBmaSBmaXJzdAojZGVmaW5lIHNlIHNlY29uZAojZGVmaW5lIGxsIGxvbmcgbG9uZwp1c2luZyBuYW1lc3BhY2Ugc3RkOwpjb25zdCBpbnQgTUFYTiA9IDEwMTA7CnBhaXI8aW50LCBpbnQ+IGNbTUFYTl07CnZlY3RvcjxwYWlyPGludCwgcGFpcjxpbnQsIGludD4+PiBlZGdlOwppbnQgbjsKc3RydWN0IERTVXsKICAgIGludCBwYXJlbnRbTUFYTl07CiAgICBEU1UoKXsKICAgICAgICBmb3IgKGludCBpID0gMTsgaSA8PSBuOyBpKyspewogICAgICAgICAgICAgcGFyZW50W2ldID0gaTsKICAgICAgICB9CiAgICB9CiAgICBp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