#include #include #include #include #include #include #include template class Vector2 { public: Vector2(){} Vector2(T x_, T y_) : x(x_), y(y_) {} T Norm2(); T x, y; }; template Vector2 operator + (const Vector2& left, const Vector2& right) { return Vector2(left.x + right.x, left.y + right.y); } template Vector2 operator - (const Vector2& left, const Vector2& right) { return Vector2(left.x - right.x, left.y - right.y); } template T Vector2::Norm2() { return x * x + y * y; } int main() { Vector2 p[3]; scanf("%d %d", &p[0].x, &p[0].y); scanf("%d %d", &p[1].x, &p[1].y); scanf("%d %d", &p[2].x, &p[2].y); Vector2 v[3][3]; for(int i = 0; i < 3; ++i) { for(int j = 0; j < 3; ++j) { v[i][j] = p[j] - p[i]; } } Vector2 res; bool exist = false; if( v[0][1].Norm2() == v[0][2].Norm2() and v[0][1].Norm2() * 2 == v[1][2].Norm2() ) { res = p[2] + p[1] - p[0]; exist = true; } if( v[1][0].Norm2() == v[1][2].Norm2() and v[1][0].Norm2() * 2 == v[0][2].Norm2() ) { res = p[2] + p[0] - p[1]; exist = true; } if( v[2][0].Norm2() == v[2][1].Norm2() and v[2][0].Norm2() * 2 == v[0][1].Norm2() ) { res = p[1] + p[0] - p[2]; exist = true; } if( exist ) { printf("%d %d\n", res.x, res.y); } else { printf("-1\n"); } return 0; }