commonDir returns the parent directory common to each path in the list