Jayden is a little kid that likes to study trees. From the last problem, Jayden has cut down many trees. Each tree is an undirected graph where any two nodes are connected by exactly one path. Jayden would like to find the length of the longest of the paths. That means that he wants you to do it for him.
Input Specification
The first line will have
Output Specification
On a single line, print the longest path between any two nodes in the tree.
Sample Input
6
1 2
1 3
2 4
2 5
5 6
Sample Output
4
Reaching the recursion limit on Python?
You can increase the amount of calls a recursive program in Python with the following code:
import sys
sys.setrecursionlimit(x)
Comments
@Kirito This is an actual 7 point problem.
So when it says it connects node
to node 
that path goes both ways right?
yup