Pashmak has fallen in love with an attractive girl called Parmida since one year ago...

Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also remembers that there is exactly one tree on each vertex of the square. Now, Pashmak knows the position of only two of the trees. Help him to find the position of two remaining ones.


-----Input-----

The first line contains four space-separated x_1, y_1, x_2, y_2 ( - 100 ≤ x_1, y_1, x_2, y_2 ≤ 100) integers, where x_1 and y_1 are coordinates of the first tree and x_2 and y_2 are coordinates of the second tree. It's guaranteed that the given points are distinct.


-----Output-----

If there is no solution to the problem, print -1. Otherwise print four space-separated integers x_3, y_3, x_4, y_4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. 

Note that x_3, y_3, x_4, y_4 must be in the range ( - 1000 ≤ x_3, y_3, x_4, y_4 ≤ 1000).


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

Output
1 0 1 1

Input
0 0 1 1

Output
0 1 1 0

Input
0 0 1 2

Output
-1

Difficulty: interview

Starter code:

Solutions:
x1, y1, x2, y2 = map(int, input().split())
#diagonal
if x1 != x2 and y1 != y2:
    if abs(x1 - x2) == abs(y1 - y2):
        print(x1, y2, x2, y1)
    else:
        print(-1)
#same side
elif x1 == x2:
    aux = abs(y2 - y1)
    print(x1 + aux, y1, x1 + aux, y2)
elif y1 == y2:
    aux = abs(x2 - x1)
    print(x1, y1 + aux, x2, y1 + aux)

x1, y1, x2, y2 = [int(i) for i in input().split()]
if x1 != x2:
    if y1 != y2:
        if abs(x1 - x2) != abs(y1 - y2):
            print(-1)
        else:
            print(x1, y2, x2, y1)
    else:
        delta = abs(x2 - x1)
        print(x1, y1 + delta, x2, y1 + delta)
else:
    if y1 != y2:
        delta = abs(y2 - y1)
        print(x1 + delta, y1, x1 + delta, y2)
    else:
        print(-1)
    


            


import math
x1, y1, x2, y2 = map(int,input().split())
a = abs(x1-x2)
b = abs(y1-y2)
if a == b and a != 0:
    print(x1, y2, x2, y1)
elif a == 0 and b != 0:
    print(x1 + b, y1, x1+b, y2)
elif b == 0 and a != 0:
    print(x1, y1 + a, x2, y1 + a)
else:
    print(-1)

x1,y1,x2,y2=map(int,input().split())
if x1==x2:
    print(x1+abs(y1-y2),y1,x2+abs(y1-y2),y2)
elif y1==y2:
    print(x1,y1+abs(x1-x2),x2,y2+abs(x1-x2))
elif abs(x1-x2)==abs(y1-y2):
    print(x1,y2,x2,y1)
else:
    print(-1)

a=[int(i) for i in input().split()]
x1=a[0]
y1=a[1]
x2=a[2]
y2=a[3]
l=0
if(x1==x2):
    l=abs(y1-y2)
    print(x1+l,y1,x1+l,y2)
elif(y1==y2):
    l=abs(x1-x2)
    print(x1,y1+l,x2,y1+l)
elif(abs(x1-x2)==abs(y1-y2)):
    print(x2,y1,x1,y2)
else:
    print(-1)

3

import sys

x1, y1, x2, y2 = [int(x) for x in sys.stdin.readline().split()]

if x1 == x2:
    d = abs(y1 - y2)
    x3, y3 = x1 + d, y1
    x4, y4 = x1 + d, y2
elif y1 == y2:
    d = abs(x1 - x2)
    x3, y3 = x1, y1 + d
    x4, y4 = x2, y1 + d
elif abs(x1 - x2) != abs(y1 - y2):
    print('-1')
    return
else:
    xa, xb = min(x1, x2), max(x1, x2)
    ya, yb = min(y1, y2), max(y1, y2)
    points = [(xa, ya), (xa, yb), (xb, ya), (xb, yb)]
    (x3, y3), (x4, y4) = [p for p in points if p not in [(x1, y1), (x2, y2)]]

print(x3, y3, x4, y4)


x1, y1, x2, y2 = map(int, input().split())
if x1 != x2 and y1 != y2 and abs(x2 - x1) != abs(y2 - y1): #lishnii 2 usl
    print(-1)
else:
    if abs(x2 - x1) == abs(y2 - y1):
        x3 = x1
        y3 = y2
        x4 = x2
        y4 = y1
    elif x1 != x2:
        x3 = x1
        y3 = y1 + abs(x2 - x1)
        x4 = x2
        y4 = y2 + abs(x2 - x1)
    elif y1 != y2:
        x3 = x1 + abs(y2 - y1)
        y3 = y1
        x4 = x2 + abs(y2 - y1)
        y4 = y2
    print(x3, y3, x4, y4)

m=(list(int(x) for x in input().split()))
x1=m[0]
y1=m[1]
x2=m[2]
y2=m[3]

dx=abs(x1-x2)
dy=abs(y1-y2)

if not dx:
    y3=y1
    y4=y2
    x3=x1+dy
    x4=x2+dy    
    print(x3,y3,x4,y4)
elif not dy:
    x3=x1
    x4=x2
    y3=y1+dx
    y4=y2+dx
    print(x3,y3,x4,y4)
else:
    if dx==dy:
        x3=x1
        y3=y2
        x4=x2
        y4=y1
        print(x3,y3,x4,y4)  
    else:
        print("-1")

x1,y1,x2,y2=map(int,input().split())
if(x1==x2):
    temp=abs(y1-y2)
    x3=x1+temp
    x4=x3
    print(x3,end=' ')
    print(y1,end=' ')
    print(x4,end=' ')
    print(y2,end=' ')
elif(y1==y2):
    temp=abs(x1-x2)
    y3=y1+temp
    y4=y3
    print(x1,end=' ')
    print(y3,end=' ')
    print(x2,end=' ')
    print(y4,end=' ')
elif(abs(x1-x2)==abs(y1-y2)):
    temp=abs(x1-x2)
    x3=x2
    x4=x1
    y3=y1
    y4=y2
    print(x3,end=' ')
    print(y3,end=' ')
    print(x4,end=' ')
    print(y4,end=' ')
else:
    print("-1")


x1, y1, x2, y2 = list(map(int, input().split()))

if x1 == x2:
    d = abs(y2 - y1)
    print(x1 + d, y1, x2 + d, y2)
elif y1 == y2:
    d = abs(x1 - x2)
    print(x1, y1 + d, x2, y2 + d)
elif abs(x1 - x2) != abs(y1 - y2):
    print('-1')
else:
    d = abs(x1 - x2)
    if (min(x1, x2), max(y1, y2)) == (x1, y1) or\
            (min(x1, x2), max(y1, y2)) == (x2, y2):
        print(min(x1, x2), min(y1, y2), max(x1, x2), max(y1, y2))
    else:
        print(min(x1, x2), max(y1, y2), max(x1, x2), min(y1, y2))



def process(x1, y1, x2, y2):
    if x1 == x2:
        print('{0} {1} {0} {2}'.format(x1 + abs(y2 - y1), y1, y2))
    elif y1 == y2:
        print('{1} {0} {2} {0}'.format(y1 + abs(x2 - x1), x1, x2))
    elif abs(y2 - y1) == abs(x2 - x1):
        print('{0} {3} {2} {1}'.format(x1, y1, x2, y2))
    else:
        print(-1)


def __starting_point():
    process(*(int(i) for i in input().split(' ')))


__starting_point()

x1, y1, x2, y2 = map(int,input().split())
if abs(x1-x2) == abs(y1-y2):
   print (x1, y2, x2, y1)
elif x1 == x2:
   print (x1+abs(y1-y2), y1, x2 + abs(y1-y2), y2)
elif y1 == y2:
   print (x1, y1+abs(x1-x2), x2, y2+abs(x1-x2))
else:
   print(-1)

#!/usr/bin/env python3

x1, y1, x2, y2 = list (map (int, input ().split ()))

if x1 == x2:
    print(x1 + abs (y1 - y2), y1, x1 + abs (y1 - y2), y2)
elif y1 == y2:
    print(x1, abs (x1 - x2) + y1, x2, abs (x1 - x2) + y2)
elif abs (x1 - x2) == abs (y1 - y2):
    print(x1, y2, x2, y1)
else:
    print(-1)


a, b, c, d= list(map(int, input().split(' ')))
if a==c:
    if b<d:
        value = d-b
        print(a+value, b, c+value, d)
    else:
        b, d = d, b
        value = d-b
        print(a+value, b, c+value, d)
elif b==d:
    a, b = b, a
    c, d = d, c
    if b<d:
        value = d-b
        print(b, a+value, d, c+value)
    else:
        b, d = d, b
        value = d-b
        print(b, a+value, d, c+value)
elif abs(c-a) == abs(d-b):
    print(a, d, c, b)
else:
    print(-1)


import math

coordinates = input().split()
x1 = int(coordinates[0])
y1 = int(coordinates[1])
x2 = int(coordinates[2])
y2 = int(coordinates[3])

if x1 == x2:
	y3 = y1
	y4 = y2
	x3 = x1 + abs(y1-y2)
	x4 = x2 + abs(y1-y2)
	print(x3, y3, x4, y4)

elif y1 == y2:
	x3 = x1
	x4 = x2
	y3 = y1 + abs(x1 - x2)
	y4 = y2 + abs(x1 - x2)
	print(x3, y3, x4, y4)

elif (abs(x1 - x2) == abs(y1 - y2)):
	x3 = x1
	x4 = x2
	y3 = y2
	y4 = y1
	print(x3, y3, x4, y4)

else:
	print(-1)