5. Sixth-graders were discussing how old their principal is. Anya said: "He is older than 38 years." Borya said: "He is younger than 35 years." Vova: "He is younger than 40 years." Galya: "He is older than 40 years." Dima: "Borya and Vova are right." Sasha: "You are all wrong." It turned out that the boys and girls made the same number of mistakes. Can we find out how old the principal is?
Solution. Note that Anya and Vova cannot be wrong at the same time, so Sasha is wrong. Also, at least one of the pair "Anya-Borya" and at least one of the pair "Vova-Galya" is wrong. Thus, there are no fewer than three wrong answers, and due to the evenness, there are exactly four: two boys and two girls. This means that no more than one girl and no more than two boys are correct. Dima essentially confirms Borya's words. However, Borya, Dima, and Vova cannot be correct at the same time, so Borya and Dima are wrong, and among the boys, only Vova is right, and among the girls, only Anya is right. Therefore, the principal is 39 years old.