Final implementation of the task 57.