There is a forest with labeled vertices in Ddasland. The vertices are numbered . One Ddas stands on each vertex.
The Ddas standing on vertex cannot see any edge incident to . They can see every other edge and all vertex labels. Every Ddas knows the following facts.
One day, Dadas publicly announces the following fact to everyone.
This forest contains at least one edge.
The days are then numbered starting from day . On every day, all Ddases simultaneously make exactly one of the following public declarations using all declarations from earlier days.
A declaration made by another Ddas on the same day cannot be used on that day. Every declaration becomes public information on later days.
The actual forest is given. Find the first day on which some Ddas knows that at least one edge is incident to their vertex.
The input is given from Standard Input in the following format:
case case
For each test case, print the first day satisfying the condition on one line.
Each case is given in the following format:
For every , there is an undirected edge connecting vertices and .