Misha and Grisha are funny boys, so they like to use new underground. The underground has n stations connected with n-1 routes so that each route connects two stations, and it is possible to reach every station from any other.
The boys decided to have fun and came up with a plan. Namely, in some day in the morning Misha will ride the underground from station s to station f by the shortest path, and will draw with aerosol an ugly text "Misha was here" on every station he will pass through (including s and f). After that on the same day at evening Grisha will ride from station t to station f by the shortest path and will count stations with Misha's text. After that at night the underground workers will wash the texts out, because the underground should be clean.
The boys have already chosen three stations a, b and c for each of several following days, one of them should be station s on that day, another should be station f, and the remaining should be station t. They became interested how they should choose these stations s, f, t so that the number Grisha will count is as large as possible. They asked you for help.
Output
Print
q lines. In the
i-th of these lines print the maximum possible number Grisha can get counting when the stations
s,
t and
f are chosen optimally from the three stations on the
i-th day.
Note
In the first example on the first day if
s =
1,
f =
2,
t =
3, Misha would go on the route
1
2, and Grisha would go on the route
3
1
2. He would see the text at the stations
1 and
2. On the second day, if
s =
3,
f =
2,
t =
3, both boys would go on the route
3
1
2. Grisha would see the text at
3 stations.
In the second examle if
s =
1,
f =
3,
t =
2, Misha would go on the route
1
2
3, and Grisha would go on the route
2
3 and would see the text at both stations.
米莎和格里莎是有趣的男孩,所以他们喜欢使用新的地下室。地下有n个车站与n-1条路线相连,因此每条路线连接两个车站,并且可以从任何其他车站到达每个车站。
男孩们决定玩得开心,并想出了一个计划。也就是说,在早上的某一天,米莎将乘坐地铁从s站到f站,走最短的路,并在他将要经过的每个车站(包括s和f)上用气溶胶画出一个丑陋的文字“米莎在这里”。之后的同一天晚上,Grisha将以最短的路径从t站骑到f站,并用Misha的文本计算站点。之后,在晚上,地下工作人员会把文本洗出来,因为地下应该是干净的。
男孩们已经为接下来的几天中的每一天选择了三个站a、b和c,其中一个站当天应该是站s,另一个站应该是站f,剩下的站应该是t。他们向你求助。