class Yukicoder def initialize x1, y1, x2, y2, x3, y3 = gets.chomp.split.map(&:to_i) coords = [[x1,y1],[x2,y2],[x3,y3]] coords.permutation do |list| x1, y1, x2, y2, x3, y3 = *list.flatten d1 = Math.sqrt((x2-x1) ** 2 + (y2-y1) ** 2) d2 = Math.sqrt((x2-x3) ** 2 + (y2-y3) ** 2) if d1 == d2 -100.upto(100) do |y| -100.upto(100) do |x| d3 = Math.sqrt((x-x1) ** 2 + (y-y1) ** 2) d4 = Math.sqrt((x-x3) ** 2 + (y-y3) ** 2) if d1 == d3 && d2 == d4 && (x2 != x || y2 != y) puts [x, y].join(' ') return end end end end end puts -1 end end Yukicoder.new