class Calc0055 def initialize(args) args = args.map { |l| l.chomp.split(/\s+/) } @x1, @y1, @x2, @y2, @x3, @y3 = args.shift.map(&:to_i) end def calc(a, b, c) ab = (b[0] - a[0]) ** 2 + (b[1] - a[1]) ** 2 bc = (c[0] - b[0]) ** 2 + (c[1] - b[1]) ** 2 ca = (a[0] - c[0]) ** 2 + (a[1] - c[1]) ** 2 return nil unless ab == bc && 2 * ab == ca e = [(c[0] + a[0]) / 2r, (c[1] + a[1]) / 2r] be = [e[0] - b[0], e[1] - b[1]] d = [b[0] + be[0] * 2, b[1] + be[1] * 2] d.map(&:to_i).join(' ') end def run p, q, r = [@x1, @y1], [@x2, @y2], [@x3, @y3] [[p, q, r], [r, p, q], [q, r, p]].map do |a, b, c| d = calc(a, b, c) return d if d end -1 end end puts Calc0055.new(STDIN.readlines).run if __FILE__ == $0