The first lines written to os are each terminated with endl. This means that the string ends with a
newline character. Because the string is printed followed by endl, two adjacent newline characters
are written. This explains the empty lines in the output