# coding: utf-8 allXY = [int(i) for i in input().rstrip().split(" ")] xList = list(set([x for (index, x) in enumerate(allXY) if index % 2 == 0])) yList = list(set([y for (index, y) in enumerate(allXY) if index % 2 == 1])) canSquare = True if len(xList) != 2 or len(yList) != 2: 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)