Fortran 77: Three nested loop write to screen