Problem 48: solved