Dfs Algorithm Python Stack