I am having trouble coming up with a polynomial time algorithm to solve the following problem:
Let =(,) be an undirected and unweighted graph with vertices. Let _1,_2,...,_ be =−1 distinct spanning trees of . Find a polynomial time algorithm that finds a spanning tree
=(,_) in that contains at least one edge from each spanning tree _.
I would really appreciate any help on this!

Spanning trees have matroid structure. Therefore the following greedy algorithm works: starting with an empty forest, for each input spanning tree, extend the forest by any one tree edge that does not create a cycle. Correctness follows more or less directly from the augmentation property and the definition of independence.