Task 2.3.22 solution