fixed output format in problem 2