In a class, there are 39 students and their average weight is 51 kg. If we include the weight of the teacher, then the average weight becomes 51.2 kg. What is the weight of the teacher?