How do I write a program that produces the following output? | Hacker News Reader