LCA tree problem