Solution of the problem