#include using namespace std; int intpow(int a, int b) { int ans = 1; while (b) { if (b & 1) ans *= a; a *= a; b /= 2; } return ans; } int len_sqrt(vector>& V, int i) { return intpow(abs(V[i].first - V[(i + 1) % 4].first), 2) + intpow(abs(V[i].second - V[(i + 1) % 4].second), 2); } bool check(vector> V) { if ( len_sqrt(V, 0) == len_sqrt(V, 1) && len_sqrt(V, 1) == len_sqrt(V, 2) && len_sqrt(V, 2) == len_sqrt(V, 3) && V[0] != V[2] && V[1] != V[3] && (V[1].first - V[0].first) * (V[3].first - V[0].first) + (V[1].second - V[0].second) * (V[3].second - V[0].second) == 0) { return true; } return false; } int main() { vector> V(4); for (int i = 0; i < 3; i++) { int X, Y; cin >> X >> Y; V[i] = {X, Y}; } for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { if (i == j) continue; V[3] = {V[i].first + V[j].first - V[3 - i - j].first, V[i].second + V[j].second - V[3 - i - j].second}; auto V_copy = V; sort(V_copy.begin(), V_copy.end()); bool flag = false; do { if (check(V_copy)) { flag = true; break; }; } while (next_permutation(V_copy.begin(), V_copy.end())); if (flag) { cout << V[3].first << " " << V[3].second << endl; return 0; } } } cout << -1 << endl; }