I Chronicles 24:3 Midrash

וַיֶּֽחָלְקֵ֣ם דָּוִ֔יד וְצָדוֹק֙ מִן־בְּנֵ֣י אֶלְעָזָ֔ר וַאֲחִימֶ֖לֶךְ מִן־בְּנֵ֣י אִיתָמָ֑ר לִפְקֻדָּתָ֖ם בַּעֲבֹדָתָֽם׃

And David with Zadok of the sons of Eleazar, and Ahimelech of the sons of Ithamar, divided them according to their ordering in their service.

Read midrashic interpretation of I Chronicles 24:3: and classical rabbinic exegesis.