#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) * 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 = -100; xx <= 100; xx++) { for (double yy = -100; yy <= 100; 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) * 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])) { cout << int(xx) << " " << int(yy) << endl; return 0; } } } } } } } cout << -1 << endl; return 0; }