boolean dfs(HashSet<Integer>[] graph, int i, boolean[] visited,
			boolean[] visiting, ArrayList<Integer> list) {
		if (visiting[i]) {
			return false;
		}
		visiting[i] = true;
		for (Integer integer : graph[i]) {
			if (!visited[integer]) {
				if (!dfs(graph, integer, visited, visiting, list))
					return false;
			}
		}
		visiting[i] = false;
		list.add(i);
		visited[i] = true;
		return true;
	}