import numpy as np from scipy import optimize # 高精度の浮動小数点数を使用する p = np.float64(input()) points = [] for _ in range(3): x, y = map(np.float64, input().split()) points.append((x, y)) def Lp(x, y): x = np.abs(x) y = np.abs(y) ma = max(x, y) if ma < 1e-9: return np.float64(1e-9) # 非常に小さな値を返す x /= ma y /= ma x = x ** p y = y ** p return (x + y) ** (1.0 / p) * ma def f(point): x, y = point distances = [Lp(x - px, y - py) for px, py in points] d1, d2, d3 = distances return (d2 - d1) ** 2 + (d3 - d1) ** 2 + (d3 - d2) ** 2 options={"maxiter":10000} x_min = optimize.minimize(f, x0=[0, 0], method='Nelder-Mead', tol=1e-8, options=options) print(*x_min.x)