Implemented Problem 49