get least common ancestors