#include #define show(x) cout << #x << " = " << x << endl using namespace std; using ll = long long; using pii = pair; using vi = vector; template ostream& operator<<(ostream& os, const vector& v) { os << "sz=" << v.size() << "\n["; for (const auto& p : v) { os << p << ","; } os << "]\n"; return os; } template ostream& operator<<(ostream& os, const pair& p) { os << "(" << p.first << "," << p.second << ")"; return os; } constexpr ll MOD = 1e9 + 7; template constexpr T INF = numeric_limits::max() / 100; struct Vec { Vec() = default; Vec(int x, int y) : dx(x), dy(y) {} Vec(const Vec& v) : dx(v.dx), dy(v.dy) { } int dx; int dy; int normSq() const { return dx * dx + dy * dy; } int product(const Vec& v) const { return dx * v.dx + dy * v.dy; } Vec operator+(const Vec& v) const { return Vec{dx + v.dx, dy + v.dy}; } Vec operator-(const Vec& v) const { return Vec{dx - v.dx, dy - v.dy}; } bool operator<(const Vec& v) const { return normSq() > v.normSq(); } }; int main() { Vec pos[3]; for (ll i = 0; i < 3; i++) { cin >> pos[i].dx >> pos[i].dy; } pair v_[3]; v_[0].first = pos[1] - pos[0]; v_[1].first = pos[2] - pos[1]; v_[2].first = pos[0] - pos[2]; v_[0].second = 0; v_[1].second = 1; v_[2].second = 2; pair v[3]; v[0] = v_[0]; v[1] = v_[1]; v[2] = v_[2]; sort(v, v + 3); if (v[1].first.product(v[2].first) == 0 and v[1].first.normSq() == v[2].first.normSq()) { Vec ans; if (v[0].second == 0) { ans = pos[0] - v_[1].first; cout << ans.dx << " " << ans.dy << endl; } else if (v[0].second == 1) { ans = pos[1] - v_[2].first; cout << ans.dx << " " << ans.dy << endl; } else { ans = pos[2] - v_[0].first; cout << ans.dx << " " << ans.dy << endl; } } else { cout << -1 << endl; } return 0; }