Another solution to the problem