#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, k = 0, n, sum = 0;
  cin >> n;
  long long int x[n + 1], y[n + 1];
  for (i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  long long int ans = -99;
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      long long int val1 = (x[i] - x[j]) * (x[i] - x[j]);
      long long int val2 = (y[i] - y[j]) * (y[i] - y[j]);
      ans = max(ans, max(val1, val2));
    }
  }
  cout << ans << endl;
  return 0;
}
