#include #define rep(i, n) for(long long i = 0; i < n; i++) #define ALL(v) (v).begin(), (v).end() #define rALL(v) (v).rbegin(), (v).rend() using namespace std; using lint = long long; int main() { vector> xy(3); rep(i, 3) { cin >> xy[i].first >> xy[i].second; } auto dist = [](int x1, int y1, int x2, int y2) { return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2); }; auto right = [](int x1, int y1, int x2, int y2) { return x1 * x2 + y1 * y2 == 0; }; vector id = {0, 1, 2}; do { auto [x1, y1] = xy[id[0]]; auto [x2, y2] = xy[id[1]]; auto [x3, y3] = xy[id[2]]; if (dist(x1, y1, x2, y2) == dist(x2, y2, x3, y3) && right(x1 - x2, y1 - y2, x3 - x2, y3 - y2)) { int x4 = x3 + (x1 - x2); int y4 = y3 + (y1 - y2); cout << x4 << " " << y4 << endl; return 0; } } while (next_permutation(ALL(id))); cout << -1 << endl; }