import sequtils,strutils,math proc `=~`(x,y : float64):bool= if abs(x - y) < abs(x) / 1_000_000: return true else: return false proc length(s1,t1,s2,t2 : int):float64 = var s = ((s1 - s2) * (s1 - s2)).float64 t = ((t1 - t2) * (t1 - t2)).float64 return sqrt(s + t) var x1,y1,x2,y2,x3,y3 : int x,y : int (x1,y1,x2,y2,x3,y3) = stdin.readline.split.map(parseInt) var flag : bool var px,py : float64 var a = length(x1,y1,x2,y2) b = length(x2,y2,x3,y3) c = length(x3,y3,x1,y1) if b < c and a < c: if b * b + a * a =~ c * c and a =~ b: (px,py) = ((x3 + x1) / 2,(y3 + y1) / 2) x = round(px * 2).int - x2 y = round(py * 2).int - y2 flag = true elif b < a and c < a: if b * b + c * c =~ a * a and b =~ c: (px,py) = ((x2 + x1) / 2,(y2 + y1) / 2) x = round(px * 2).int - x3 y = round(py * 2).int - y3 flag = true elif a < b and c < b: if a * a + c * c =~ b * b and c =~ a: (px,py) = ((x3 + x2) / 2,(y3 + y2) / 2) x = round(px * 2).int - x1 y = round(py * 2).int - y1 flag = true if flag: echo x," ",y else: echo -1