I am trying to make a program that will take a file called "root.inp" (file contains 3 integers) as its input, with each integer in a separate line, and then perform the operation shown in picture:

![math operation](https://i.stack.imgur.com/GY62K.png)

(a, b, c are integers in said input file, s is the result)  

After that, I want to be able to write whatever is inside S into a new file called "root.out". But after some time, I cannot find a solution to this. Here's what I've tried

```
program Formula;
type
  input = record
    firstnum: integer;
    secondnum: integer;
    thirdnum: integer;
  end;
  output = record
    sum: real;
  end;
var 
  f: file of input;
  p: file of output;
  S: real;
  a, b, c: integer;
begin
  assign (f, 'root.inp');
  reset (f);
  while not eof(f) do;
  begin
    read (f,input);
    a := input.firstnum;
    b := input.secondnum;
    c := input.thirdnum;
    S := (a*a + b*b + c*c) / (a*b*c) + sqrt(a*b*c);
  end;
  close (f);
  assign (p, 'root.out');
  rewrite(p);
  output.sum := S;
  write(p, output);
  close(p);
end.

```

After executing, the 'root.out' file is completely blank, but the program did not show any error while compiling. I cannot find a cause for this.