output for problem 3