시간 제한
메모리 제한
시간 제한
1초
메모리 제한
128 MB

The administration of the University would like to put on the lanes pictures of the winners of Regional Collegiate Programming Contest in such way that the pictures of winners from the same university to be on the lanes of a same simple cycle. That is why the administration would like to assign the longest simple cycles of lanes to most successful universities. The problem is to find the longest cycles? Fortunately, it happens that each lane of the park is participating in no more than one simple cycle (see the Figure).
On the first line of the input file the number T of the test cases will be given. Each test case starts with a line with the positive integers N and M, separated by interval (4 ≤ N ≤ 4444). Each of the next M lines of the test case contains the labels of one of the pairs of crossroads connected by a lane.
For each of the test cases, on a single line of the output, print the length of a maximal simple cycle.