Primate social organization evolved from a flexible pairliving ancestor