David, Eleazar’s descendant Zadok, and Ithamar’s descendant Ahimelech divided Aaron’s descendants into groups for service.