require 'matrix' ax,ay,bx,by,cx,cy=gets.split.map! &:to_i def pr(v); puts "#{v[0]} #{v[1]}"; end p1 = Vector[ax,ay] p2 = Vector[bx,by] p3 = Vector[cx,cy] v1 = p1-p2 v2 = p2-p3 v3 = p3-p1 if v1.dot(v2) == 0 if v1.r==v2.r pr p1-v2 exit end end if v2.dot(v3) == 0 if v2.r==v3.r pr p2-v3 exit end end if v3.dot(v1) == 0 if v3.r==v1.r pr p3-v1 exit end end p -1