lca with parent pointer