common ancestor in tree