#include <bits/stdc++.h>
using namespace std;
const long long inf = (long long)1e9 + 1;
long long sqr(long long x) { return x * x; }
int main() {
  int n;
  scanf("%d", &n);
  vector<pair<long long, long long> > A(n);
  for (int i = 0; i < n; i++) {
    scanf("%I64d %I64d", &A[i].first, &A[i].second);
  }
  long long ans = (long long)8e18;
  for (int it = 0; it < 2; it++) {
    multiset<long long> S;
    for (int i = 0; i < n; i++) {
      S.insert(A[i].first);
      swap(A[i].first, A[i].second);
    }
    ans = min(ans, sqr(*S.rbegin() - *S.begin()));
  }
  for (int it = 0; it < 2; it++) {
    sort(A.begin(), A.end());
    long long l = 0, r = (long long)1e9 + 7;
    vector<long long> P(n), S(n);
    P[0] = A[0].second;
    for (int i = 1; i < n; i++) P[i] = max(P[i - 1], A[i].second);
    S[n - 1] = A[n - 1].second;
    for (int i = n - 2; i >= 0; i--) S[i] = max(S[i + 1], A[i].second);
    vector<long long> P2(n), S2(n);
    P2[0] = A[0].second;
    for (int i = 1; i < n; i++) P2[i] = min(P2[i - 1], A[i].second);
    S2[n - 1] = A[n - 1].second;
    for (int i = n - 2; i >= 0; i--) S2[i] = min(S2[i + 1], A[i].second);
    while (r - l > 1) {
      long long m = (l + r) / 2;
      bool ok = false;
      ;
      long long cur = (long long)8e18 + 1;
      for (int L = 0; L < n; L++) {
        int ind1 =
            upper_bound(A.begin(), A.end(), make_pair(abs(A[L].first), inf)) -
            A.begin();
        int ind2 =
            upper_bound(A.begin(), A.end(), make_pair(m + A[L].first, inf)) -
            A.begin();
        long long maxy = 0;
        long long miny = 0;
        if (min(ind1, ind2) < n)
          maxy = max(maxy, S[min(ind1, ind2)]),
          miny = min(miny, S2[min(ind1, ind2)]);
        if (L) maxy = max(maxy, P[L - 1]), miny = min(miny, P2[L - 1]);
        long long maxyt = max(abs(miny), abs(maxy));
        long long t = max(sqr(maxyt) + sqr(A[L].first),
                          sqr(A[min(ind1, ind2) - 1].first - A[L].first));
        t = max(t, sqr(maxy - miny));
        ;
        ans = min(ans, t);
        if (t <= m * m) ok = true;
      }
      if (ok)
        ;
      ;
      if (ok) {
        r = m;
      } else {
        l = m;
      }
    }
    for (int L = 0; L < n; L++) {
      int ind1 =
          upper_bound(A.begin(), A.end(), make_pair(abs(A[L].first), inf)) -
          A.begin();
      int ind2 =
          upper_bound(A.begin(), A.end(), make_pair(r + A[L].first, inf)) -
          A.begin();
      long long maxy = 0;
      long long miny = 0;
      if (min(ind1, ind2) < n)
        maxy = max(maxy, S[min(ind1, ind2)]),
        miny = min(miny, S2[min(ind1, ind2)]);
      if (L) maxy = max(maxy, P[L - 1]), miny = min(miny, P2[L - 1]);
      long long maxyt = max(abs(miny), abs(maxy));
      long long t = max(sqr(maxyt) + sqr(A[L].first),
                        sqr(A[min(ind1, ind2) - 1].first - A[L].first));
      t = max(t, sqr(maxy - miny));
      ans = min(ans, t);
    }
    for (int i = 0; i < n; i++) A[i].first *= -1;
  }
  printf("%I64d\n", ans);
  return 0;
}
