Task #5 for Smirnov, task #6 for Barsukov and Romanov