Implemented solution of other problem