# coding: utf-8 allXY = [int(i) for i in input().rstrip().split(" ")] xList = [x for (index, x) in enumerate(allXY) if index % 2 == 0] yList = [y for (index, y) in enumerate(allXY) if index % 2 == 1] canSquare = True if len(set(xList)) != 2 or len(set(yList)) != 2: canSquare = False if abs(max(xList) - min(xList)) != abs(max(yList) - min(yList)): canSquare = False ans = -1 if canSquare: x = [p for p in xList if len([sub for sub in xList if sub == p]) == 1][0] y = [p for p in yList if len([sub for sub in yList if sub == p]) == 1][0] ans = str(x) + " " + str(y) print(ans)