#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int n;
pair<int, int> pt[2][maxn];
int maxPref[maxn], maxSuff[maxn], minPref[maxn], minSuff[maxn];
long long solve(int t) {
  for (int i = 1; i <= n; i++) {
    maxPref[i] = max(maxPref[i - 1], pt[t][i].second);
    minPref[i] = min(minPref[i - 1], pt[t][i].second);
  }
  for (int i = n; i >= 1; i--) {
    maxSuff[i] = max(maxSuff[i + 1], pt[t][i].second);
    minSuff[i] = min(minSuff[i + 1], pt[t][i].second);
  }
  long long l = -1, r = 1e18;
  while (r - l > 1) {
    long long m = (l + r) >> 1;
    int i = 1, j = 1;
    bool found = (1ll * (pt[t][n].first - pt[t][1].first) *
                  (pt[t][n].first - pt[t][1].first)) <= m;
    while (!found && i <= n) {
      while ((1ll * (pt[t][i].first - pt[t][j].first) *
              (pt[t][i].first - pt[t][j].first)) > m)
        j++;
      long long mn = min(minPref[j - 1], minSuff[i + 1]);
      long long mx = max(maxPref[j - 1], maxSuff[i + 1]);
      found |= (1ll * (mx - mn) * (mx - mn)) <= m &&
               max((1ll * (mn) * (mn)), (1ll * (mx) * (mx))) +
                       max((1ll * (pt[t][i].first) * (pt[t][i].first)),
                           (1ll * (pt[t][j].first) * (pt[t][j].first))) <=
                   m;
      i++;
    }
    if (found)
      r = m;
    else
      l = m;
  }
  return r;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x, y;
    cin >> x >> y;
    pt[0][i] = make_pair(x, y);
    pt[1][i] = make_pair(y, x);
  }
  sort(pt[0] + 1, pt[0] + n + 1);
  sort(pt[1] + 1, pt[1] + n + 1);
  cout << min(solve(0), solve(1));
  return 0;
}
