Problem 9 in go.