How do you fix the timetable when a teacher is off sick?

Every morning the deputy head rebuilds the day. The AI finds who can cover for a teacher off sick and moves only what has to move.