private static void dfs(int n, ArrayList<ArrayList<Integer>> g, ArrayList<Integer> results, boolean[] visited){
		visited[n]=true;
		for(Integer neighbor:g.get(n)){
			if(!visited[neighbor]){
				dfs(neighbor, g, results, visited);
			}
		}
		results.add(n);
	}