package no055; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Vector2[] v = new Vector2[4]; for(int i=0;i<3;i++) { v[i] = new Vector2(sc.nextInt(),sc.nextInt()); } for(int x=-200;x<=200;x++) { for(int y=-200;y<=200;y++) { v[3] = new Vector2(x,y); if (isSquare(v)) { System.out.println(v[3]); return; } } } System.out.println(-1); } public static boolean isSquare(Vector2[] v) { long[] l = new long[6]; int ind = 0; for(int i=0;i<4;i++) { for(int j=i+1;j<4;j++) { l[ind++] = v[i].distSquare(v[j]); } } Arrays.sort(l); long a = l[0]; return l[1] == a && l[2] == a && l[3] == a && l[4] == a * 2 && l[5] == a * 2; } } class Vector2 { int x = 0; int y = 0; public Vector2(int x,int y) { this.x = x; this.y = y; } public int dot(Vector2 v) { return this.x*v.x+this.y*v.y; } public int cross(Vector2 v) { return this.x*v.y-this.y*v.x; } public Vector2 add(Vector2 v) { return new Vector2(this.x+v.x,this.y+v.y); } public Vector2 subtract(Vector2 v) { return new Vector2(this.x-v.x,this.y-v.y); } public Vector2 multiply(int k) { return new Vector2(k*this.x,k*this.y); } public long normSquare() { return x * x + y * y; } public long distSquare(Vector2 v) { return this.subtract(v).normSquare(); } public String toString() { return this.x + " " + this.y; } }