using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static string InputPattern = "Input5";
static List<string> GetInputList()
{
var WillReturn = new List<string>();
if (InputPattern == "Input1") {
WillReturn.Add("0 0 1 0 0 1");
//1 1
//(0,0)、(1,0)、(0,1)の3点がわかっている。
//残りの1点を(1,1)とすれば1辺の長さが1の正方形が描ける。
}
else if (InputPattern == "Input2") {
WillReturn.Add("0 0 2 0 2 1");
//-1
//長方形は描けるがどうがんばっても正方形は描けない。
//よって、-1が答えになる。
}
else if (InputPattern == "Input3") {
WillReturn.Add("1 2 2 -1 -1 -2");
//-2 1
//正方形は辺がx軸、y軸に平行で無くても良い
}
else if (InputPattern == "Input4") {
WillReturn.Add("8 10 14 14 13 9");
//9 15
}
else {
string wkStr;
while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
}
return WillReturn;
}
static void Main()
{
List<string> InputList = GetInputList();
int[] wkArr = InputList[0].Split(' ').Select(X => int.Parse(X)).ToArray();
int X1 = wkArr[0];
int Y1 = wkArr[1];
int X2 = wkArr[2];
int Y2 = wkArr[3];
int X3 = wkArr[4];
int Y3 = wkArr[5];
int X4, Y4;
//場合1 線12が対角線となる場合
//4=1+ベクトル32
X4 = X1 + X2 - X3;
Y4 = Y1 + Y2 - Y3;
if (IsSquare(X1, Y1, X3, Y3, X2, Y2, X4, Y4)) {
Console.WriteLine("{0} {1}", X4, Y4);
return;
}
//場合2 線13が対角線となる場合
//4=1+ベクトル23
X4 = X1 + X3 - X2;
Y4 = Y1 + Y3 - Y2;
if (IsSquare(X1, Y1, X2, Y2, X3, Y3, X4, Y4)) {
Console.WriteLine("{0} {1}", X4, Y4);
return;
}
//場合3 線14が対角線となる場合
//4=1+ベクトル13+ベクトル12
X4 = X1 + X3 - X1 + X2 - X1;
Y4 = Y1 + Y3 - Y1 + Y2 - Y1;
if (IsSquare(X1, Y1, X2, Y2, X4, Y4, X3, Y3)) {
Console.WriteLine("{0} {1}", X4, Y4);
return;
}
Console.WriteLine(-1);
}
//傾きを返す
static void DeriveKatamuki(int pX1, int pY1, int pX2, int pY2, out int pBunsi, out int pBunbo)
{
pBunsi = pY2 - pY1;
pBunbo = pX2 - pX1;
}
//ABCDが正方形かを返す
static bool IsSquare(int AX, int AY, int BX, int BY, int CX, int CY, int DX, int DY)
{
int Kyori1 = CalcKyori(AX, AY, BX, BY);
int Kyori2 = CalcKyori(BX, BY, CX, CY);
int Kyori3 = CalcKyori(CX, CY, DX, DY);
int Kyori4 = CalcKyori(AX, AY, DX, DY);
//4つの辺の長さが等しいこと
if (Kyori1 != Kyori2) return false;
if (Kyori1 != Kyori3) return false;
if (Kyori1 != Kyori4) return false;
int Bunsi1, Bunbo1; DeriveKatamuki(AX, AY, BX, BY, out Bunsi1, out Bunbo1);
int Bunsi2, Bunbo2; DeriveKatamuki(BX, BY, CX, CY, out Bunsi2, out Bunbo2);
int Bunsi3, Bunbo3; DeriveKatamuki(CX, CY, DX, DY, out Bunsi3, out Bunbo3);
int Bunsi4, Bunbo4; DeriveKatamuki(DX, DY, AX, AY, out Bunsi4, out Bunbo4);
Func<int, int, int, int, bool> Is90Do = (pBunsi1, pBunbo1, pBunsi2, pBunbo2) =>
{
if (pBunsi1 == 0 && pBunbo2 == 0) return true;
if (pBunbo1 == 0 && pBunsi2 == 0) return true;
if (pBunsi1 * pBunsi2 % (pBunbo1 * pBunbo2) != 0) return false;
return (pBunsi1 * pBunsi2 / (pBunbo1 * pBunbo2) == -1);
};
if (Is90Do(Bunsi1, Bunbo1, Bunsi2, Bunbo2) == false) return false;
if (Is90Do(Bunsi2, Bunbo2, Bunsi3, Bunbo3) == false) return false;
if (Is90Do(Bunsi3, Bunbo3, Bunsi4, Bunbo4) == false) return false;
if (Is90Do(Bunsi4, Bunbo4, Bunsi1, Bunbo1) == false) return false;
return true;
}
//ユークリッド距離の2乗を返す
static int CalcKyori(int pX1, int pY1, int pX2, int pY2)
{
return (pX1 - pX2) * (pX1 - pX2) + (pY1 - pY2) * (pY1 - pY2);
}
}