#include #include #include int main(void) { int i, a, b, f = 0; double ra[3], rb[3], l[3], x, y; for (i = 0; i < 3; i++) { scanf("%d %d", &a, &b); ra[i] = (double)a; rb[i] = (double)b; } for (i = 0; i < 3; i++) l[i] = sqrt(pow(ra[i] - ra[(i + 1) % 3], 2.0) + pow(rb[i] - rb[(i + 1) % 3], 2.0)); x = y = 0.0; for (i = 0; i < 3; i++) { if (fabs(l[i] - l[(i + 1) % 3]) <= 1e-6 && fabs(pow(l[i], 2.0) + pow(l[(i + 1) % 3], 2.0) - pow(l[(i + 2) % 3], 2.0)) <= 1e-6) { switch (i) { case 0: x = ra[0] - ra[1] + ra[2]; y = rb[0] - rb[1] + rb[2]; break; case 1: x = ra[0] + ra[1] - ra[2]; y = rb[0] + rb[1] - rb[2]; break; case 2: x = -ra[0] + ra[1] + ra[2]; y = -rb[0] + rb[1] + rb[2]; break; } f = 1; } } if (f == 1) printf("%d %d", (int)x, (int)y); else printf("-1"); return EXIT_SUCCESS; }