#include <bits/stdc++.h>
using namespace std;
const int MaxN = 1e6 + 10;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const long long LINF = 1e18;
int n, x[MaxN], y[MaxN];
vector<pair<int, int> > pt;
long long maxSuff[MaxN], maxPref[MaxN];
long long minSuff[MaxN], minPref[MaxN];
long long pref[MaxN], suff[MaxN];
long long fpref[MaxN], fsuff[MaxN];
long long sqr(int x) { return 1LL * x * x; }
long long cost(int i, int j) {
  long long res = 0;
  if (i > 0) {
    res = max(res, pref[i - 1]);
  }
  if (j + 1 < n) {
    res = max(res, suff[j + 1]);
  }
  if (i > 0 && j + 1 < n) {
    res = max(res, sqr(minPref[i - 1] - maxSuff[j + 1]));
    res = max(res, sqr(maxPref[i - 1] - minSuff[j + 1]));
  }
  return res;
}
bool can(long long d) {
  for (int i = 0, j = 0; i < (int)pt.size(); ++i) {
    if (pt[i].first <= 0) {
      int l = i, r = (int)pt.size() - 1, j = i;
      while (l <= r) {
        int m = (l + r) / 2;
        if (abs(pt[m].first) <= abs(pt[i].first) &&
            sqr(pt[m].first - pt[i].first) <= d) {
          j = m;
          l = m + 1;
        } else {
          r = m - 1;
        }
      }
      if (max(cost(i, j), sqr(max((i > 0 ? fpref[i - 1] : 0LL), fsuff[j + 1])) +
                              sqr(pt[i].first)) <= d) {
        return true;
      }
    } else {
      int l = 0, r = i, j = i;
      while (l <= r) {
        int m = (l + r) / 2;
        if (abs(pt[m].first) <= abs(pt[i].first) &&
            sqr(pt[m].first - pt[i].first) <= d) {
          j = m;
          r = m - 1;
        } else {
          l = m + 1;
        }
      }
      if (max(cost(j, i), sqr(max((j > 0 ? fpref[j - 1] : 0), fsuff[i + 1])) +
                              sqr(pt[i].first)) <= d) {
        return true;
      }
    }
  }
  return false;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &x[i], &y[i]);
    pt.push_back(make_pair(x[i], y[i]));
  }
  sort(pt.begin(), pt.end());
  set<int> a, b;
  for (int i = 0; i < (int)pt.size(); ++i) {
    fpref[i] = abs(pt[i].second);
    a.insert(pt[i].second);
    minPref[i] = maxPref[i] = pt[i].second;
    pref[i] = sqr(*a.rbegin() - *a.begin());
    if (i > 0) {
      fpref[i] = max(fpref[i - 1], fpref[i]);
      maxPref[i] = max(maxPref[i - 1], maxPref[i]);
      minPref[i] = min(minPref[i - 1], minPref[i]);
    }
  }
  for (int i = n - 1; i >= 0; --i) {
    fsuff[i] = abs(pt[i].second);
    b.insert(pt[i].second);
    minSuff[i] = maxSuff[i] = pt[i].second;
    suff[i] = sqr(*b.rbegin() - *b.begin());
    if (i + 1 < n) {
      fsuff[i] = max(fsuff[i + 1], fsuff[i]);
      maxSuff[i] = max(maxSuff[i + 1], maxSuff[i]);
      minSuff[i] = min(minSuff[i + 1], minSuff[i]);
    }
  }
  long long l = 0, r = LINF, ans = LINF;
  while (l <= r) {
    long long m = (l + r) / 2;
    if (can(m)) {
      ans = m;
      r = m - 1;
    } else {
      l = m + 1;
    }
  }
  ans = min(ans, sqr(pt.back().first - pt[0].first));
  cout << min(ans, pref[n - 1]) << '\n';
  return 0;
}
