Assigning main teachers to classes