import java.io.*;
//import Numeric;
//import Text;


class gradleast
{
 public static void main(String args[]) throws IOException
 {
 f yy=new f();
 df dy=new df();
 double k2;
 double e[]={1.656333333e3,-2.480583e6,1.792522e1,-8.86838e-2,4.617861e2,1.666666667e3};
 double xi[];
 xi=new double[500];
 double yi[];
 yi=new double[500];
 DataInputStream cin=new DataInputStream(System.in);
 System.out.println("name of input file : ");
 String in_name=Text.readString(cin);
 System.out.println(" ");
 //DataInputStream fin=new DataInputStream(new FileInputStream(in_name));
 BufferedReader fin=new BufferedReader(new FileReader(in_name));
 int i=-1;
 try {
 while(fin != null)
 {
   i++;
   xi[i]=Text.readDouble(fin);
   yi[i]=Text.readDouble(fin);
   System.out.println(" "+xi[i]+" "+yi[i]);
 }
     } catch(EOFException e_eof) {System.out.println("end of file"); }

 double x[]=new double[i];
 double y[]=new double[i];
 for(i=0;i<x.length;i++)
 {
 x[i]=xi[i];
 y[i]=yi[i];
 }
 e=grads(xi,yi,e,100,1e-10,1e-10,1);
 //System.out.println("k2="+k2);
 //System.out.println(Matrix.toString(marquart.A(dy,x,y,e,10.0)));
 //System.out.println(Matrix.toStringT(marquart.B(yy,dy,x,y,e)));
 System.out.println(Matrix.toStringT(e));
 }
   public static double y(double t,double a[])
   {
     double y;
     double T=t+273.15;
     y=a[0]+a[1]/T+a[2]*Math.log(T)/Math.log(10)+a[3]*T+
       a[4]*(a[5]-T)/T*Math.log(a[5]-T)/Math.log(10.0);
     return Math.pow(10.0,y);
   }
   
   public static double dy(double t,double a[],int k)
   {
      double Ps;
      double T=t+273.15;
      int n=a.length;
      Ps=a[0]+a[1]/T+a[2]*Math.log(T)/Math.log(10)+a[3]*T+
      a[4]*(a[5]-T)/T*Math.log(a[5]-T)/Math.log(10.0);
      Ps=Math.pow(10.0,Ps);
      double ln10=Math.log(10.0);
      double lna5=Math.log(a[5]-T);
      double ll=Ps*ln10;
      double da[]={ll,ll/T,Ps*Math.log(T),T*ln10,(a[5]-T)/T*lna5,a[4]/T*(lna5+1)};
      return da[k];
   }
    
   public static double X2(double xi[], double yi[], double a[]) 
   {
     int i;
     double sum = 0;
     double dif;
     double yf;
     for (i = 0; i < xi.length; i++) 
     {
       yf=y(xi[i], a);
	   dif = yi[i] - yf;
       //System.out.println("i="+i+"xi="+xi[i]+"yi="+yi[i]+"yf="+yf+"dif="+dif);
       sum += dif * dif;
     }
     return sum;
   }

   public static double dX2(int k, double xi[], double yi[], double a[]) 
   {
     int i;
     double sum = 0;
     double dif;
     for (i = 0; i < xi.length; i++) {
       dif = (yi[i] - y(xi[i], a)) * dy(xi[i], a, k);
       sum += dif;
     }
     return -2.0*sum;
   }
   
   public static double[] dX2(double xi[], double yi[], double a[])
   {
   int n=a.length;
   double xx[]=new double[n];
   for(int k=0;k<n;k++)
   {
   xx[k]=dX2(k,xi,yi,a);
   }
   return xx;
   } 

      
public static double[] grads(double xi[], double yi[],double P0[],double max1,double delta,double epsilon,int print)
{
    //GRADS   Gradient search for a minimum of non-linear multivariable function
    // Inputs
    //   Fn        name of the vector function
    //   Gn        gradient for Fn
    //   P0        starting point
    //   max1      maximum number of iterations
    //   delta     convergence tolerance for the independent variables
    //   epsilon   convergence tolerance for the dependent variable
    //   show      if show==1 the iterations are displayed
    //
    //   P0        point V0 for the minimum
    //   y0        function value  Fn(V0)
    //   h         minimum step size
    //   err       error  estimate
    //---------------------------------------------------------------------------

    int n = P0.length;
    int maxj = 20;
    double big = 1e8;
    double h = 1.0;
    double len = Matrix.norm(P0);
    double y0 = X2(xi,yi,P0);
    if (len > 1e4) {
      h = len / 1e4;
    }
    double err = 1;
    double cnt = 0;
    double cond = 0;
    double P[] = new double[n];
    double P1[] = new double[n];
    double P2[] = new double[n];
    double Pmin[] = new double[n];
    double Y, y1, y2, ymin, hmin;
    double S[]=new double[n];
    double h0,h1,h2;
    double e0,e1,e2,d;
    int i;
    for(i=0;i<n;i++)
    { P[i]=P0[i]; }
    Y= y0;
    while (cnt<max1 && cond!=5 && (h>delta || err>epsilon))
    {
      double z[] = dX2(xi,yi,P0);
      for (i = 0; i < n; i++) {
            S[i] = z[i];
          }
      P1 = Matrix.add(P0, Matrix.multiply(S, h));
      P2 = Matrix.add(P0, Matrix.multiply(S, (2.0 * h)));
      y1 = X2(xi,yi,P1);
      y2 = X2(xi,yi,P2);
      cond = 0;
      int j = 0;
      while (j < maxj && cond == 0) {
        len = Matrix.norm(P0);
        if (y0 < y1) {
          for (i = 0; i < n; i++) {
            P2[i] = P1[i];
          }
          y2 = y1;
          h = h / 2.0;
          P1 = Matrix.add(P0, Matrix.multiply(S, h));
          y1 = X2(xi,yi,P1);
        }
        else {
          if (y2 < y1) {
            for (i = 0; i < n; i++) {
              P1[i] = P2[i];
            }
            y1 = y2;
            h = 2 * h;
            P2 = Matrix.add(P0, Matrix.multiply(S, (2.0 * h)));
            y2 = X2(xi,yi,P2);
          }
          else cond = -1;
        }
        j++;
        if (h < delta) {
          cond = 1;
        }
        if (Math.abs(h) > big || len > big) {cond = 5;}
      }
      if (cond == 5) {
        for (i = 0; i < n; i++) {
          Pmin[i] = P1[i];
        }
        ymin = y1;
      }
      else {
        d = 4 * y1 - 2 * y0 - 2 * y2; // Start of a long block:
        if (d < 0) {hmin = h * (4 * y1 - 3 * y0 - y2) / d;}
        else {
          cond = 4;
          hmin = h / 3.0;
        }
        Pmin = Matrix.add(P0, Matrix.multiply(S, hmin));
        ymin = X2(xi,yi,Pmin);
        h0 = Math.abs(hmin);
        h1 = Math.abs(hmin - h);
        h2 = Math.abs(hmin - 2.0 * h);
        if (h0 < h) {
          h = h0;
        }
        if (h1 < h) {
          h = h1;
        }
        if (h2 < h) {
          h = h2;
        }
        if (h == 0) {
          h = hmin;
        }
        if (h < delta) {
          cond = 1;
        }
        e0 = Math.abs(y0 - ymin);
        e1 = Math.abs(y1 - ymin);
        e2 = Math.abs(y2 - ymin);
        if (e0 != 0 && e0 < err) {
          err = e0;
        }
        if (e1 != 0 && e1 < err) {
          err = e1;
        }
        if (e2 != 0 && e2 < err) {
          err = e2;
        }
        if (e0 == 0 && e1 == 0 && e2 == 0) {
          err = 0;
        }
        if (err < epsilon) {
          cond = 2;
        }
        if (cond == 2 && h < delta) {
          cond = 3;
        }
      } //end of if(cond==5)
      cnt++;
      for (i = 0; i < n; i++) {
        P0[i] = Pmin[i];
      }
      y0 = ymin;
      if(print==1)
       {System.out.println("x min = "+Matrix.toString(P0)+"/nymin = "+y0+"/nerror estimate ="+err+"/nminimum step size "+h); }
    } //end of while
    return P0;
}
}
