int main()
{
double x_A, y_A, x_B, y_B, x_C, y_C;
double length_AB, length_AC, length_BC;
double sq[3] = { 0 };
cin >> x_A >> y_A >> x_B >> y_B >> x_C >> y_C;
double slope_1, slope_2;
slope_1 = abs(y_B - y_A) / abs(x_B - x_A);
slope_2 = abs(y_C - y_B) / abs(x_C - x_B);
if (slope_1 == slope_2)
{
cout << "-1";
return 0;
}
length_AB = sqrt((x_A - x_B) * (x_A - x_B) + (y_A - y_B) * (y_A - y_B));
length_AC = sqrt((x_A - x_C) * (x_A - x_C) + (y_A - y_C) * (y_A - y_C));
length_BC = sqrt((x_B - x_C) * (x_B - x_C) + (y_B - y_C) * (y_B - y_C));
sq[0] = (length_AB + length_AC) * 2;
sq[1] = (length_AB + length_BC) * 2;
sq[2] = (length_AC + length_BC) * 2;
sort(sq, sq + 3);
cout << fixed;
cout.precision(16);
cout << sq[2] - sq[0];
return 0;
}