update for poj3177,get bridge,num of leaves