#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, k, n, a[1000], b[1000];
  cin >> n;
  for (k = 0; k < n; k++) {
    cin >> a[k] >> b[k];
  }
  long long int xx, nx, ny, xy;
  xx = a[0];
  nx = a[0];
  ny = b[0];
  xy = b[0];
  for (i = 1; i < n; i++) {
    if (a[i] < nx) {
      nx = a[i];
    }
    if (a[i] > xx) {
      xx = a[i];
    }
  }
  for (i = 1; i < n; i++) {
    if (b[i] < ny) {
      ny = b[i];
    }
    if (b[i] > xy) {
      xy = b[i];
    }
  }
  unsigned long long int l, br;
  l = xx - nx;
  br = xy - ny;
  if (l > br) {
    cout << l * l;
  } else {
    cout << br * br;
  }
}
