#include #include #include using namespace std; struct z{ int x,y; bool operator<(z A){ if(x == A.x){ return y < A.y; } return x < A.x; } bool operator==(z A){ return x == A.x && y == A.y; } bool operator >(z A){ return !((*this) < A || (*this) == A); } }; int dist(z a,z b){ return abs(a.x-b.x)*abs(a.x-b.x) + abs(a.y-b.y)*abs(a.y-b.y); } int main(){ vector A(4); for(int i = 0; 3 > i; i++){ cin>>A[i].x>>A[i].y; } for(int i = -100; 100 >= i; i++){ for(int j = -100; 100 >= j; j++){ A[3].x = i; A[3].y = j; if(A[0] == A[3] || A[1] == A[3] || A[2] == A[3])continue; vector B(4); for(int k = 0; 4 > k; k++){ B[k] = A[k]; } sort(B.begin(),B.end()); do{ int di = dist(B[0],B[1]); bool ok = true; for(int k = 0; 4 > k; k++){ if(di != dist(B[k],B[(k+1)%4])){ ok = false; break; } } if(ok && dist(B[0],B[2]) == 2*di && dist(B[1],B[3]) == 2*di){ cout << i << " " << j << endl; return 0; } }while(next_permutation(B.begin(),B.end())); } } cout << -1 << endl; }