uva 11504, needs more cleaning up. Solved after ~5 days.tarjan+non-recursive dfs+in-edges