After making bad dives into swimming pools, Wilbur wants to build a swimming pool in the shape of a rectangle in his backyard. He has set up coordinate axes, and he wants the sides of the rectangle to be parallel to them. Of course, the area of the rectangle must be positive. Wilbur had all four vertices of the planned pool written on a paper, until his friend came along and erased some of the vertices.

Now Wilbur is wondering, if the remaining n vertices of the initial rectangle give enough information to restore the area of the planned swimming pool.


-----Input-----

The first line of the input contains a single integer n (1 ≤ n ≤ 4) — the number of vertices that were not erased by Wilbur's friend.

Each of the following n lines contains two integers x_{i} and y_{i} ( - 1000 ≤ x_{i}, y_{i} ≤ 1000) —the coordinates of the i-th vertex that remains. Vertices are given in an arbitrary order.

It's guaranteed that these points are distinct vertices of some rectangle, that has positive area and which sides are parallel to the coordinate axes.


-----Output-----

Print the area of the initial rectangle if it could be uniquely determined by the points remaining. Otherwise, print  - 1. 


-----Examples-----
Input
2
0 0
1 1

Output
1

Input
1
1 1

Output
-1



-----Note-----

In the first sample, two opposite corners of the initial rectangle are given, and that gives enough information to say that the rectangle is actually a unit square.

In the second sample there is only one vertex left and this is definitely not enough to uniquely define the area.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
points = [[int(x) for x in input().split()] for _ in range(n)]
if n <= 1:
	print(-1)
	return
dx = [1e9, -1e9]
dy = [1e9, -1e9]
for x, y in points:
	dx[0] = min(dx[0], x)
	dx[1] = max(dx[1], x)
	dy[0] = min(dy[0], y)
	dy[1] = max(dy[1], y)
area = (dx[1] - dx[0]) * (dy[1] - dy[0])
if area:
	print(area)
else:
	print(-1)


n = int(input())

X = []
Y = []
for i in range(n):
    x, y = list(map(int, input().split()))
    X.append(x)
    Y.append(y)

dx = max(X) - min(X)
dy = max(Y) - min(Y)

ans = dx * dy
if (ans > 0):
    print(ans)
else:
    print(-1)



#!/usr/bin/env python3

import itertools

def main():
    n = int(input())
    a = [ ]
    for i in range(n):
        a.append(tuple(map(int, input().split())))
    for a, b in itertools.combinations(a, 2):
        if a[0] != b[0] and a[1] != b[1]:
            print(abs((a[0] - b[0]) * (a[1] - b[1])))
            break
    else:
        print(-1)

try:
    while True:
        main()
except EOFError:
    pass


n = int(input())
a = []
for i in range(n):
	a.append(tuple(map(int, input().split())))

x1, y1, x2, y2 = float('inf'), float('inf'), float('inf'), float('inf')
for i in a:
	if x1 == float('inf'):
		x1 = i[0]
	elif x2 == float('inf') and x1 != i[0]:
		x2 = i[0]
	
	if y1 == float('inf'):
		y1 = i[1]
	elif y2 == float('inf') and y1 != i[1]:
		y2 = i[1]

if y2 == float('inf') or x2 == float('inf'):
	print('-1')
else:
	print(abs(x1 - x2) * abs(y1 - y2))


n = int(input())
a = [[int(i) for i in input().split()] for j in range(n)]
for i in range(n):
    for j in range(i + 1, n):
        if a[i][0] != a[j][0] and a[i][1] != a[j][1]:
            print(abs(a[i][0] - a[j][0]) * abs(a[i][1] - a[j][1]))
            return
print(-1)

n = int(input())
xs = set()
ys = set()
for i in range(n):
    x, y = map(int, input().split())
    xs.add(x)
    ys.add(y)
if len(xs) == 2 and len(ys) == 2:
    x1, x2 = xs
    y1, y2 = ys
    print(abs((x1 - x2)*(y1 - y2)))
else:
    print(-1)

n = int(input())
xset = set()
yset = set()
for i in range(n):
    x, y = list(map(int, input().split()))
    xset.add(x)
    yset.add(y)
if len(xset) == 2 and len(yset) == 2:
    xset = list(xset)
    yset = list(yset)
    print(abs(xset[0] - xset[1]) * abs(yset[0] - yset[1]))
else:
    print(-1)


n = int(input())

if n == 1 or n == 0:
    print(-1)
elif n == 2:
    x1, y1 = [int(x) for x in input().split()]
    x2, y2 = [int(x) for x in input().split()]
    
    if x1 == x2 or y1 == y2:
        print(-1)
    else:
        print(abs((x1 - x2) * (y1 - y2)))
elif n == 3:
    x1, y1 = [int(x) for x in input().split()]
    x2, y2 = [int(x) for x in input().split()]
    x3, y3 = [int(x) for x in input().split()]
    
    print(abs((max(x1, max(x2, x3)) -  min(x1, min(x2, x3))) * (max(y1, max(y2, y3)) -  min(y1, min(y2, y3)))))
else:
    x1, y1 = [int(x) for x in input().split()]
    x2, y2 = [int(x) for x in input().split()]
    x3, y3 = [int(x) for x in input().split()]
    x4, y4 = [int(x) for x in input().split()]
    
    print(abs((max(x1, max(x2, x3)) -  min(x1, min(x2, x3))) * (max(y1, max(y2, y3)) -  min(y1, min(y2, y3)))))

3

n = int(input())
arr = [tuple(map(int, input().split())) for i in range(n)]
arr.sort()

mna = 1791
mxa = -1791
mnb = 1791
mxb = -1791
for i in range(n):
    mna = min(mna, arr[i][0])
    mnb = min(mnb, arr[i][1])
    mxa = max(mxa, arr[i][0])
    mxb = max(mxb, arr[i][1])

if mna == mxa or mnb == mxb:
    print(-1)
else:
    print((mxa - mna) * (mxb - mnb))


def main():
	n = int(input())

	X = []
	Y = []

	for _ in range(n):
		x, y = list(map(int, input().split()))
		X.append(x)
		Y.append(y)

	if n == 1:
		return -1

	xleft = min(X)
	xright = max(X)
	ybot = min(Y)
	ytop = max(Y)

	if xleft != xright and ybot != ytop:
		return (ytop-ybot) * (xright-xleft)
	else:
		return -1

print(main())


n = int(input())
a = [tuple(map(int, input().split())) for i in range(n)]

xmin = 100000
xmax = -100000
ymin = 100000
ymax = -100000

for b in a:
    xmin = min(xmin, b[0])
    xmax = max(xmax, b[0])
    ymin = min(ymin, b[1])
    ymax = max(ymax, b[1])

r = (xmax-xmin) * (ymax-ymin)
if r == 0:
    print(-1)
else:
    print(r)


n = int(input())
v = []
for i in range(n):
    v.append(list(map(int, input().split())))

ans = False
for xi, yi in v:
    if ans:
        break

    for xj, yj in v:
        if xi != xj and yi != yj:
            print(abs(xi - xj) * abs(yi - yj))
            ans = True
            break

if not ans:
    print(-1)


n = int(input())
lst = []
for i in range(n):
    a, b = list(map(int, input().split()))
    lst.append([a, b])
if n == 1:
    print(-1)
elif n == 2 and lst[0][0] != lst[1][0] and lst[0][1] != lst[1][1]:
    print(abs(lst[0][0] - lst[1][0]) * abs(lst[0][1] - lst[1][1]))
elif n == 2:
    print(-1)
    
elif n == 3 or n == 4:
    if lst[0][0] != lst[1][0] and lst[0][1] != lst[1][1]:
        print(abs(lst[0][0] - lst[1][0]) * abs(lst[0][1] - lst[1][1]))
    elif lst[1][0] != lst[2][0] and lst[1][1] != lst[2][1]:
        print(abs(lst[1][0] - lst[2][0]) * abs(lst[1][1] - lst[2][1]))
    else:
        print(abs(lst[0][0] - lst[2][0]) * abs(lst[0][1] - lst[2][1]))
            

    
    


"""
Codeforces Round #331 (Div. 2)

Problem 596 A

@author yamaton
@date 2015-11-15
"""

import itertools as it
import functools
import operator
import collections
import math
import sys


def solve(pairs, n):
    if n <= 1:
        return -1
    elif n == 2:
        (a, b) = pairs[0]
        (c, d) = pairs[1]
        if a == c or b == d:
            return -1
        else:
            return abs(a-c) * abs(b-d)
    elif n >= 3:
        xmin = min(x for (x, _) in pairs)
        xmax = max(x for (x, _) in pairs)
        ymin = min(y for (_, y) in pairs)
        ymax = max(y for (_, y) in pairs)
        return (xmax - xmin) * (ymax - ymin)


# def p(*args, **kwargs):
#     return print(*args, file=sys.stderr, **kwargs)


def main():
    n = int(input())
    pairs = [tuple(int(_c) for _c in input().strip().split()) for _ in range(n)]
    assert len(pairs[0]) == 2

    result = solve(pairs, n)
    print(result)


def __starting_point():
    main()

__starting_point()

n = int(input())
a = {}
b = {}
for i in range(n):
    t1, t2 = map(int, input().split())
    a[t1] = t1
    b[t2] = t2
if (len(a) < 2 or len(b) < 2):
    print(-1)
else:
    r1 = 0
    flag = 0
    for i in a:
        if (flag == 1):
            r1 -= i
        else:
            r1 += i
            flag = 1
    r2 = 0
    flag = 0
    for i in b:
        if (flag == 1):
            r2 -= i
        else:
            r2 += i
            flag = 1
    r = r1 * r2
    if (r < 0):
        r *= -1
    print(r)

n = int(input())
if n == 1:
    print(-1)
elif n == 2:
    x1, y1 = list(map(int, input().split()))
    x2, y2 = list(map(int, input().split()))
    if x1 != x2 and y1 != y2:
        print(abs(x1 - x2) * abs(y1 - y2))
    else:
        print(-1)
elif n == 3:
    x1, y1 = list(map(int, input().split()))
    x2, y2 = list(map(int, input().split()))    
    x3, y3 = list(map(int, input().split()))
    if x1 != x2 and y1 != y2:
        print(abs(x1 - x2) * abs(y1 - y2))    
    elif x1 != x3 and y1 != y3:
        print(abs(x1 - x3) * abs(y1 - y3))
    else:
        print(abs(x2 - x3) * abs(y2 - y3))
else:
    x1, y1 = list(map(int, input().split()))
    x2, y2 = list(map(int, input().split()))    
    x3, y3 = list(map(int, input().split()))
    x4, y4 = list(map(int, input().split()))
    if x1 != x2 and y1 != y2:
        print(abs(x1 - x2) * abs(y1 - y2))    
    elif x1 != x3 and y1 != y3:
        print(abs(x1 - x3) * abs(y1 - y3))
    else:
        print(abs(x2 - x3) * abs(y2 - y3))    
   


n = int(input())
p = [0] * n
for i in range(n):
    p[i] = tuple(map(int, input().split()))
    
if n == 4:
    for i in range(1, 4):
        if p[0][0] != p[i][0] and p[0][1] != p[i][1]:
            res = abs(p[0][0] - p[i][0]) * abs(p[0][1] - p[i][1])
elif n == 3:
    for i in range(1, 3):
        if p[0][0] != p[i][0] and p[0][1] != p[i][1]:
            res = abs(p[0][0] - p[i][0]) * abs(p[0][1] - p[i][1])
    for i in [0, 2]:
            if p[1][0] != p[i][0] and p[1][1] != p[i][1]:
                res = abs(p[1][0] - p[i][0]) * abs(p[1][1] - p[i][1])
elif n == 2:
    if p[0][0] != p[1][0] and p[0][1] != p[1][1]:
        res = abs(p[0][0] - p[1][0]) * abs(p[0][1] - p[1][1])
    else: res = -1

else:
    res = -1
    
print(res)

n = int(input())
x, y = [], []
for i in range(n):
    _x, _y = list(map(int, input().split()))
    x.append(_x)
    y.append(_y)
x = sorted(set(x))
y = sorted(set(y))
if len(x) == 2 and len(y) == 2:
    print((x[1] - x[0]) * (y[1] - y[0]))
else:
    print(-1)


#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import time

#   = input()
n   = int(input())
x   = []
y   = []

for i in range(n):
    (X, Y) = (int(i) for i in input().split())
    x.append(X)
    y.append(Y)

start = time.time()

x = list(set(x))
y = list(set(y))

if len(x) < 2 or len(y) <2:
    print(-1)
else:
    ans = (x[1] - x[0])*(y[1] - y[0])
    if ans < 0:
        ans = -ans
    print(ans)

finish = time.time()
#print(finish - start)


def solve():
    N = int(input())
    X = [0] * N
    Y = [0] * N

    for i in range(N):
        X[i], Y[i] = list(map(int, input().split()))

    xs = list(set(X))
    ys = list(set(Y))

    if len(xs) == 1 or len(ys) == 1:
        print(-1)
        return

    print(abs(xs[1] - xs[0]) * abs(ys[1] - ys[0]))


def __starting_point():
    solve()

__starting_point()

n = int(input())
if (n == 1):
    print(-1)
elif (n == 2):
    x1, y1 = list(map(int, input().split()))
    x2, y2 = list(map(int, input().split()))
    if (x1 == x2) or (y1 == y2):
        print(-1)
    else:
        print(abs(x2 - x1) * abs(y2 - y1))
else:
    x1, y1 = list(map(int, input().split()))
    x2, y2 = list(map(int, input().split()))
    x3, y3 = list(map(int, input().split()))
    if (x1 == x2) or (y1 == y2):
        if (x1 == x3) or (y1 == y3):
            print(abs(x3 - x2) * abs(y3 - y2))
        else:
            print(abs(x3 - x1) * abs(y3 - y1))
    else:
        print(abs(x2 - x1) * abs(y2 - y1))


#!/usr/bin/env python3
def f(a, b):
    return abs((a[0] - b[0]) * (a[1] - b[1]))
n = int(input())
x = [list(map(int,input().split())) for i in range(n)]
y = 0
for i in range(n):
    for j in range(i+1, n):
        if not y:
            y = f(x[i], x[j])
print(y or -1)


n = int(input())
a = []
S = 0

for i in range(n):
   a.append(tuple(map(int, input().split())))
for i in range(n):
   for j in range(n):
      S = max(S, abs((a[i][0] - a[j][0])*(a[i][1] - a[j][1])))

if S == 0:
   print(-1)
else:
   print(S)
   


n=int(input())
x=[]
y=[]
while n>0:
    n-=1
    s=input()
    a=[int(i) for i in s.split(' ')]
    x.append(a[0])
    y.append(a[1])
kx,ky,xx,yy=0,0,-2000,-2000
dx,dy=0,0
for i in x:
    if xx!=i and kx<2:
        kx+=1
        if xx!=-2000:
            dx=abs(xx-i)
        xx=i
for i in y:
    if yy!=i and ky<2:
        ky+=1
        if yy!=-2000:
            dy=abs(yy-i)
        yy=i
if kx==2 and ky==2:
    SS=dx*dy
    print(SS)
else:
    print(-1)