#include <bits/stdc++.h>
using namespace std;
const int mx = 100100;
const int md = 1e9 + 7;
const double EULER = 2.71828182845904523536;
bool compare(const pair<int, int>& a, const pair<int, int>& b) {
  return a.first > b.first || (a.first == b.first && a.second < b.second);
}
int main() {
  vector<pair<int, int> > arr;
  int n, x, y;
  cin >> n;
  for (int i = 0; i < n; i += 1) {
    cin >> x >> y;
    arr.push_back(make_pair(x, y));
  }
  x = y = -1;
  if (n == 1)
    cout << "-1\n";
  else {
    for (int i = 0; i < n; i += 1) {
      for (int j = i + 1; j < n; j += 1) {
        if (arr[i].first != arr[j].first and arr[i].second != arr[j].second) {
          int a, b;
          a = abs(arr[i].first - arr[j].first);
          b = abs(arr[i].second - arr[j].second);
          if (x != -1) {
            if (x != a and y != b) {
              printf("-1\n");
              return 0;
            }
          }
          x = a;
          y = b;
        }
      }
    }
    if (x == -1)
      printf("-1\n");
    else
      printf("%d\n", x * y);
  }
}
