#include using namespace std; int dis(int x1, int x2, int y1, int y2) { return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2); } int main() { int x1, y1, x2, y2, x3, y3; cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3; int d1 = dis(x1, x2, y1, y2); int d2 = dis(x1, x3, y1, y3); int d4 = dis(x2, x3, y2, y3); for (int x4 = -100; x4 <= 100; x4++) { for (int y4 = -100; y4 <= 100; y4++) { int d3 = dis(x1, x4, y1, y4); int d5 = dis(x3, x4, y3, y4); int d6 = dis(x2, x4, y2, y4); vector d = {d1, d2, d3, d4, d5, d6}; sort(d.begin(), d.end()); if (d[0] == d[1] && d[1] == d[2] && d[2] == d[3] && d[0] * 2 == d[5] && d[4] == d[5]) { cout << x4 << ' ' << y4 << '\n'; return 0; } } } cout << -1 << endl; }