private void dfs(Graph G, int v, int p)
	{
		marked[v] = true;

		for (int w : G.adj(v))
			if (!marked[w])
			{
				if (!hasCycle())
					cycle.push(v);
				dfs(G, w, v);
				if (!hasCycle())
					cycle.pop();
			}
			else
			{
				if (w != p)
				{
					hasCycle = true;
				}
			}
	}