Epam test task, train sort