What code have you worked on for this problem?

What is printed on each line? How is what is printed on the next line related to what was on the last line?