Hi Your program seems to be right but the statement write(nx, ny, "\n") should be write("\n", nx, " ", ny) or something like this (read() removes the '\n' and the 2nd line is joined with the 1st). Bye Mauro