7.3 On the Island of Truth and Lies, there are knights who always tell the truth, and liars who always lie. One day, 17 residents of the island lined up by height (from tallest to shortest, the tallest being the first) for a game. Each had to say one of the phrases: "There is a liar below me" or "There is a knight above me." In the end, those standing from the third to the sixth position said the first phrase, while the rest said the second. How many knights were among these 17 people, if all residents have different heights?
Answer: 14

Solution. The formation cannot consist of only liars (in such a case, 3-6 would be telling the truth). Consider the tallest knight, let's call him P. He could only say the first phrase, so the 1st and 2nd positions must be occupied by liars, and P stands from the 3rd to the 6th position. Moreover, there is a liar who is shorter than P, let's call him L. This liar cannot say the second phrase, so he must say the first phrase and stand no later than the 6th position but not earlier than the 4th position. Therefore, from the 7th to the 17th position, only knights stand. The 3rd position cannot be occupied by a liar, as there is a liar L who is shorter than him. Therefore, the 3rd position is occupied by P. If there are other liars between P and L, they must also say the first phrase, but L is shorter than them, which is a contradiction.

We conclude that liars stand at the 1st, 2nd, and 6th positions, while the remaining positions are occupied by knights.