You shall appoint judges and officers to you within all your gates that YHWH your God gives to you, according to your tribes, and they shall judge the people with righteous judgment.