You must appoint judges and officers in all your gates, which the Lord your God gives you, throughout your tribes, and they shall judge the people with righteous judgment.