import numpy as np N =int(input()) xdata =[i for i in range(N)] ydata =list(map(float,input().split())) cov = np.cov(xdata,ydata) varx =cov[0][0] vary =cov[1][1] covxy =cov[1][0] meany = np.mean(ydata) meanx = np.mean(xdata) print(covxy) A = covxy / varx B = meany -A*meanx C = (vary -(covxy**2)/varx)*(N-1) print(B,A) print(C)