Write out on paper what is happening...a line is read, then another line is read, then the line variable printed. You want to read a line, print a line, read a line print a line, etc...