#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> a[1000 * 1000];
long long ans, n, m, mi[1000 * 1000], ma[1000 * 1000];
bool check(long long d) {
  int l = 1;
  long long A, B, v, u;
  for (int i = 1; i <= n; i++) {
    while (l <= n &&
           ((a[l].first - a[i].first) * (a[l].first - a[i].first)) <= d) {
      l++;
      if (i == 1 && l > n) return 1;
      if (i == 1) {
        A = mi[l];
        B = ma[l];
      }
      if (i > 1) {
        A = min(v, mi[l]);
        B = max(u, ma[l]);
      }
      long long cur = max(((A) * (A)) + ((a[i].first) * (a[i].first)),
                          ((A) * (A)) + ((a[l - 1].first) * (a[l - 1].first)));
      cur = max(((B) * (B)) + ((a[i].first) * (a[i].first)), cur);
      cur = max(cur, ((B) * (B)) + ((a[l - 1].first) * (a[l - 1].first)));
      cur = max(cur, ((B - A) * (B - A)));
      if (i == 1) v = a[i].second, u = a[i].second;
      if (cur <= d) return 1;
    }
    v = min(v, a[i].second);
    u = max(u, a[i].second);
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i].first >> a[i].second;
  sort(a + 1, a + 1 + n);
  mi[n] = ma[n] = a[n].second;
  for (int i = n - 1; i >= 1; i--) {
    mi[i] = min(mi[i + 1], a[i].second);
    ma[i] = max(ma[i + 1], a[i].second);
  }
  mi[n + 1] = 1e18;
  ma[n + 1] = -1e18;
  long long m, l = -1, r = 1e18;
  while (r - l > 1) {
    m = (l + r) >> 1;
    if (check(m))
      r = m;
    else
      l = m;
  }
  ans = r;
  for (int i = 1; i <= n; i++) swap(a[i].first, a[i].second);
  sort(a + 1, a + 1 + n);
  mi[n] = ma[n] = a[n].second;
  for (int i = n - 1; i >= 1; i--) {
    mi[i] = min(mi[i + 1], a[i].second);
    ma[i] = max(ma[i + 1], a[i].second);
  }
  mi[n + 1] = 1e18;
  ma[n + 1] = -1e18;
  m, l = -1, r = 1e18;
  while (r - l > 1) {
    m = (l + r) >> 1;
    if (check(m))
      r = m;
    else
      l = m;
  }
  ans = min(ans, r);
  cout << ans;
}
