#include using namespace std; typedef complex P; #define rep(i,n) for(int i=0;i> x >> y; ps[i] = P(x, y); } int per[3]; rep(i, 3) per[i] = i; bool ok = 0; P ans; do { P v = ps[per[1]] - ps[per[0]]; double len = abs(v); if(ps[per[1]] + v*P(0,1) != ps[per[2]]) continue; P p3 = ps[per[2]] + v*P(0,1)*P(0,1); if(ps[per[0]] != p3 + v*P(0,1)*P(0,1)*P(0,1)) continue; ok = 1; ans = p3; break; } while(next_permutation(per, per+3)); if(ok) { cout << (int)ans.real() << " " << (int)ans.imag() << endl; } else { cout << -1 << endl; } return 0; }