Reference input for problem 18