using System; using System.Drawing; using System.Linq; class Program { public static int DistanceSquare(Point first, Point second) { var dx = first.X - second.X; var dy = first.Y - second.Y; return dx*dx + dy*dy; } private static Point ToVector(Point first, Point second) { return new Point(second.X - first.X, second.Y - first.Y); } private static bool IsDiagnostic(Point firstVector, Point secondVector) { if (firstVector.X*secondVector.X + firstVector.Y*secondVector.Y == 0) { return true; } return false; } private static Point CreateFourth(Point opposite, Point lineStart, Point lineEnd) { var x = opposite.X + (lineStart.X + lineEnd.X)/2; var y = opposite.Y + (lineStart.Y + lineEnd.Y)/2; return new Point(x, y); } public static void Main(string[] args) { var values = Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); Point[] points = new Point[3]; points[0] = new Point(values[0], values[1]); points[1] = new Point(values[2], values[3]); points[2] = new Point(values[4], values[5]); if (DistanceSquare(points[0], points[1]) == DistanceSquare(points[1], points[2])) { if (!IsDiagnostic(ToVector(points[1], points[0]), ToVector(points[2], points[1]))) { Console.WriteLine(-1); return; } var fourth = CreateFourth(points[1], points[0], points[2]); Console.WriteLine("{0} {1}", fourth.X, fourth.Y); return; } if (DistanceSquare(points[0], points[2]) != DistanceSquare(points[1], points[2])) { if (!IsDiagnostic(ToVector(points[2], points[0]), ToVector(points[2], points[1]))) { Console.WriteLine(-1); return; } var fourth = CreateFourth(points[2], points[0], points[1]); Console.WriteLine("{0} {1}", fourth.X, fourth.Y); return; } if (DistanceSquare(points[0], points[1]) != DistanceSquare(points[0], points[2])) { if (!IsDiagnostic(ToVector(points[1], points[0]), ToVector(points[2], points[0]))) { Console.WriteLine(-1); return; } var fourth = CreateFourth(points[0], points[2], points[1]); Console.WriteLine("{0} {1}", fourth.X, fourth.Y); return; } Console.WriteLine(-1); } }