#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) #define FOR(i,b,e) for (int i=(int)(b); i<(int)(e); i++) #define ALL(x) (x).begin(), (x).end() const double PI = acos(-1); double EPS = 1e-9; bool check(vector > ps) { double gx = 0, gy = 0; for (auto p: ps) { gx += p.first; gy += p.second; } gx /= 4, gy /= 4; vector > rps; for (auto p: ps) { int x = p.first; int y = p.second; double theta = atan2(y-gy, x-gx); if (theta < 0) theta += 2 * PI; rps.emplace_back(theta, x, y); } sort(rps.begin(), rps.end()); bool ck = true; REP (i, 4) { int j = (i + 1) % 4; int k = (i + 3) % 4; int x1 = get<1>(rps[j]) - get<1>(rps[i]); int y1 = get<2>(rps[j]) - get<2>(rps[i]); int x2 = get<1>(rps[k]) - get<1>(rps[i]); int y2 = get<2>(rps[k]) - get<2>(rps[i]); ck &= x1 * x2 + y1 * y2 == 0; ck &= abs(hypot(x1, y1) - hypot(x2, y2)) < EPS; } return ck; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); vector > ps; REP (i, 3) { int x, y; cin >> x >> y; ps.emplace_back(x, y); } for (int x = -500; x <= 500; x++) { for (int y = -500; y <= 500; y++) { ps.emplace_back(x, y); if (check(ps)) { cout << x << " " << y << endl; return 0; } ps.pop_back(); } } cout << -1 << endl; return 0; }