find common ancestor