topological sorting

visit shbcf.ru