#include <bits/stdc++.h>
using namespace std;
int n;
pair<int, int> r[100005];
const int inf = 998244353;
struct th {
  int mx, mn, m[2];
  th() {
    mx = -inf, mn = inf;
    m[0] = -inf, m[1] = inf;
  }
  th(int a) {
    mx = -inf, mn = inf;
    if (a > 0)
      mx = a;
    else
      mn = a;
    m[0] = m[1] = a;
  }
  th u(th f) {
    th fn;
    fn.mx = max(mx, f.mx), fn.mn = min(mn, f.mn);
    fn.m[0] = max(m[0], f.m[0]), fn.m[1] = min(m[1], f.m[1]);
    return fn;
  }
};
th fr[100005], ed[100005], cur[100005];
int u[100005];
long long sq(int a) { return 1ll * a * a; }
bool check(long long k) {
  int sqr = sqrt(k) - 10;
  sqr = max(sqr, 0);
  while (sq(sqr + 1) <= k) sqr++;
  if (sq(ed[1].m[0] - ed[1].m[1]) <= k) return 1;
  for (int i = 1; i <= n; i++) {
    int ls, rs;
    if (r[i].first >= 0)
      ls = max(-r[i].first, r[i].first - sqr), rs = r[i].first;
    else
      ls = r[i].first, rs = min(-r[i].first, r[i].first + sqr);
    th g;
    ls = lower_bound(u + 1, u + n + 1, ls) - u;
    g = fr[ls - 1];
    rs = lower_bound(u + 1, u + n + 1, rs + 1) - u;
    g = g.u(ed[rs]);
    if (g.m[0] - g.m[1] > sqr) continue;
    if (g.mx >= 0 && 1ll * g.mx * g.mx + 1ll * r[i].first * r[i].first > k)
      continue;
    if (g.mn <= 0 && sq(g.mn) + sq(r[i].first) > k) continue;
    return 1;
  }
  return 0;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d%d", &r[i].first, &r[i].second);
  sort(r + 1, r + n + 1);
  for (int i = 1; i <= n; i++) u[i] = r[i].first;
  for (int i = 1; i <= n; i++) cur[i] = th(r[i].second);
  for (int i = 1; i <= n; i++) fr[i] = fr[i - 1].u(cur[i]);
  for (int i = n; i >= 1; i--) ed[i] = ed[i + 1].u(cur[i]);
  long long ls = 0, rs = 1e18;
  while (ls < rs) {
    long long mid = (ls + rs) >> 1;
    if (check(mid))
      rs = mid;
    else
      ls = mid + 1;
  }
  cout << ls << endl;
  return 0;
}
