#include using namespace std; using i64 = int64_t; using vi = vector; using vvi = vector; struct Point { int x, y; Point operator+(const Point rhs) { return {x + rhs.x, y + rhs.y}; } Point operator/(const int k) { return {x / k, y / k}; } int dist(const Point rhs) { return abs(x - rhs.x) + abs(y - rhs.y); } bool operator==(const Point rhs) { return x == rhs.x && y == rhs.y; } }; bool isSquare(vector points) { for (int i = 0; i < 4; i++) { for (int j = i + 1; j < 4; j++) { if (points[i] == points[j]) { return false; } } } for (int i = 0; i < 4; i++) { for (int j = i + 1; j < 4; j++) { Point G = (points[i] + points[j]) / 2; int ok = 1; int D = points[0].dist(G); for (int k = 1; k < 4; k++) { if (D != points[k].dist(G)) { ok = 0; } } if (ok) { return true; } } } return false; } int main() { vector hoge; for (int i = 0; i < 3; i++) { int x, y; cin >> x >> y; hoge.push_back({2 * x, 2 * y}); } for (int i = -100; i <= 100; i++) { for (int j = -100; j <= 100; j++) { vector fuga(hoge); fuga.push_back({2 * i, 2 * j}); if (isSquare(fuga)) { cout << i << " " << j << endl; return 0; } } } cout << -1 << endl; }