Greetings $M$.  Around a round table, $N$ knights are seated. Every morning, the wizard Merlin seats them in a different order. Starting from the second day, Merlin allows the knights to make as many swaps as they like during the day: two adjacent knights can swap places if and only if they were not neighbors on the first day. The knights try to sit in the same order as on one of the previous days: then the meetings will end. What is the maximum number of days Merlin can guarantee to hold meetings?  (Seatings that can be obtained from each other by rotation are considered the same. Merlin does not sit at the table.)
Number the knights sitting on the first day clockwise from 1 to $N$. We will describe the order at the table by a string of these numbers, listing the knights clockwise. Let's call the selected orders of the form $k, k-1, \ldots, 2,1, k+1, k+2, \ldots, N$ for $k=1,2,3, \ldots, N-1$ (the $N$-th selected order coincides with the $(N-1)$-th, so it is not needed). We will prove that from any order, it is possible to rearrange to a selected one.

To do this, we will perform a seating rearrangement in which the left group $k, k-1, \ldots, 2,1$ is the largest possible. We will show that the remaining knights automatically sit in the required order ($k+1, k+2, \ldots, N$). Suppose this is not the case. We will move the number $k+1$ clockwise. If $k+1$ runs into $k+2$, we will move this pair. Running into $k+3$ with the pair, we will move the triplet, and so on. In the end, a train $k+1, k+2, \ldots, k+m$ will reach $k$. At this point, $k+m<N$ (otherwise, there would have been no movement at all). We will pass all the numbers of the train, except $k+1$, through the left group, and attach $k+1$ to it. This contradicts the maximality of the left group.

It is clear that by rearranging in a selected order each day, the knights will repeat no later than on the $N$-th day. Suppose Merlin performs such a traversal for an arbitrary order: moving clockwise all the time, he will go from the 1st to the 2nd, then to the 3rd, to the 4th, ..., to the $N$-th, and again to the 1st. We will associate with the order the number of laps Merlin makes around the table. It is easy to see that the number of laps does not change with the allowed seating rearrangement of two knights. However, the number of laps for the selected orders are different (for the $k$-th order, the number of laps is $k$), so selected orders with different $k$ cannot be obtained from each other by rearrangements. By seating the knights in the next selected order, Merlin can get the first repetition no earlier than on the $N$-th day.

## Answer

$N$ days.