Described a solution for the second problem