#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR(I,A,B) for(int I = (A); I < (B); ++I) typedef long long ll; double d(double x1, double y1, double x2, double y2) { return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); } int main(){ double x[3], y[3]; FOR (i,0,3) { cin >> x[i] >> y[i]; } FOR(i,0,3) { if(d(x[i%3], y[i%3], x[(i+1)%3], y[(i+1)%3]) == d(x[i%3], y[i%3], x[(i+2)%3], y[(i+2)%3])) { if(sqrt(2.0) * d(x[i%3],y[i%3],x[(i+1)%3],y[(i+1)%3]) == d(x[(i+2)%3],y[(i+2)%3],x[(i+1)%3],y[(i+1)%3])) { // 正方形になる点を探す for (double xx = -200; xx <= 200; xx++) { for (double yy = -200; yy <= 200; yy++) { if(d(xx, yy, x[(i+1)%3], y[(i+1)%3]) == d(xx, yy, x[(i+2)%3], y[(i+2)%3])) { if(sqrt(2.0) * d(xx,yy,x[(i+1)%3],y[(i+1)%3]) == d(x[(i+2)%3],y[(i+2)%3],x[(i+1)%3],y[(i+1)%3])) { if(xx == x[i%3] && yy == y[i%3]) continue; cout << int(xx) << " " << int(yy) << endl; return 0; } } } } } } } cout << -1 << endl; return 0; }