#define _USE_MATH_DEFINES #include using namespace std; bool is_rectangle(pair a[4]) { vector x; for(int i = 0; i < 4; i++) { for(int j = i + 1; j < 4; j++) { int s = (a[i].first - a[j].first); int t = (a[i].second - a[j].second); x.push_back(s * s + t * t); } } sort(x.begin(), x.end()); return x[0] == x[3] && x[4] == x[5] && x[0] * 2 == x[5]; } int main() { ios::sync_with_stdio(false); cin.tie(0); pair a[4]; for(int i = 0; i < 3; i++) { cin >> a[i].first >> a[i].second; } for(int i = -200; i <= 200; i++) { for(int j = -200; j <= 200; j++) { a[3].first = i; a[3].second = j; if(is_rectangle(a)) { cout << i << " " << j << endl; return 0; } } } cout << -1 << endl; return 0; }