same-tree AC