Solving problem 77