#include using namespace std; #define X real() #define Y imag() typedef int D; typedef complex P; int norm(P p1, P p2){ return (p1.X-p2.X)*(p1.X-p2.X)+(p1.Y-p2.Y)*(p1.Y-p2.Y); } inline D inprd(const P &a, const P &b){ return (conj(a) * b).X; } int main(){ P p[4]; for(int i = 0; i < 3; i++){ int x,y; cin >> x >> y; p[i] = P(x,y); } int ci = -1; int n[2]; // 中間点の判定 for(int i = 0; i < 3; i++){ int k = 0; for(int j = 0; j < 3; j++){ if(i == j) continue; n[k++] = norm(p[i],p[j]); } if(n[0]==n[1]) ci = i; } if(ci < 0){ cout << -1 << endl; return 0; } swap(p[0], p[ci]); if(inprd(p[0]-p[1],p[0]-p[2]) != 0){ cout << -1 << endl; return 0; } int x = p[1].X + p[2].X - p[0].X; int y = p[1].Y + p[2].Y - p[0].Y; cout << x << " " << y << endl; return 0; }