I pasted the code into Delphi... It seems the actual results are:

3
5
5
5
57
2

Well, at least I got one right! ops: