hard ust topo-sort