The classroom as a sorting machine: The influence of teachers, friends, and peers on students’ outcomes