An undirected weighted tree is given. Find the length of the longest simple path in the tree; that is, find two vertices such that the distance between them is maximized.
The first line contains the number of vertices in the tree (2 \le n \le 10^5).
Each of the following n - 1 lines describes an edge of the tree. Each line contains three integers , , and , where and are the numbers of the vertices connected by the edge (vertices are numbered from to ), and (1 \le w \le 10^5) is the weight of the edge.
Print the length of the longest path in the tree.

Example 1