CC lives on the tree which has N nodes.On every leaf of the tree there is an apple(leaf means there is only one branch connect this node ) .Now CC wants to get two apple ,CC can choose any node to start and the speed of CC is one meter per second. now she wants to know the shortest time to get two apples;
输入解释
Thers are many cases; The first line of every case there is a number N(2<=N<=10000) if n is 0 means the end of input. Next there is n-1 lines,on the i+1 line there is three number ai,bi,ci which means there is a branch connect node ai and node bi. (1<=ai, bi<=N , 1<=ci<=2000) ci means the len of the branch is ci meters ;