11.8. In an alphabet of $n>1$ letters; a word is any finite sequence of letters in which any two adjacent letters are different. A word is called good if it is impossible to erase all letters from it, except for four, so that the remaining sequence is of the form $a a b b$, where $a$ and $b$ are different letters. Find the largest possible number of letters in a good word.

(D. Khramtsov)
Answer: $2 n+1$.

First solution. Let's call the length of a word the number of letters in it. Let $a_{1}, a_{2}, \ldots, a_{n}$ be the letters of the alphabet. Then it is not hard to check that the following word is good:

$$
a_{n} a_{n-1} \ldots a_{2} a_{1} a_{2} a_{1} a_{2} a_{3} \ldots a_{n}
$$

It remains to show that there are no good words of greater length.

Suppose that in an $n$-letter alphabet there exists a good word of length $2 n+2$. Then some letter (say, $a_{1}$) appears in it at least three times. Mark its second $(V)$ and penultimate $(P)$ occurrence in the word (then $V$ stands no further to the right than $P$).

Any other letter appears no more than once before $P$, and no more than once after $V$, otherwise by erasing letters one can obtain a forbidden sequence. Therefore, each of the letters $a_{2}, \ldots, a_{n}$ appears no more than twice. Moreover, if such a letter does appear twice, then one of its occurrences stands before $V$, and the other after $P$.

Suppose $a_{1}$ appears $k \geqslant 3$ times. Then between $V$ and $P$ stand at least $k-3$ letters different from $a_{1}$ (one between each pair of consecutive occurrences of $a_{1}$), and all such letters appear exactly once. Highlight $k-3$ such letters. The remaining $n-k+2$ letters can appear at most twice. Therefore, the length of the word does not exceed

$$
k+(k-3) \cdot 1+(n-k+2) \cdot 2=2 n+1
$$

which contradicts our assumption.

Second solution. We provide another proof that the length of a good word does not exceed $2 n+1$. Induction on $n \geqslant 2$. In the base case $n=2$, the letters in the word alternate, and a word of length at least 6 contains a fragment of the form $a b a b a b$, from which by erasing letters one can obtain $a a b b$.

For the inductive step, assume that in an $n$-letter alphabet there is a good word of length at least $2 n+2$. Then some letter $a$ appears in this word at least three times. Suppose that there are two letters, $a$ and $b$, each appearing at least 3 times. Let, without loss of generality, the second occurrence of $a$ stand earlier than the second occurrence of $b$; then by erasing letters one can obtain the word $a a b b$, which is impossible.

Therefore, the letter $a$ appears in the word $k \geqslant 3$ times, and all others at most twice. Then the length of the word is at least $2 n+2$ and at most $k+2(n-1)$, from which $k \geqslant 4$.

Between the second and third occurrence of the letter $a$ there is some letter $c$. This letter cannot appear in other places: if it appears after the second occurrence of $a$, then by erasing letters one can obtain $aacc$, and if before it, then $ccaa$ (since $k \geqslant 4$).

Suppose the neighbors of the letter $c$ are different. Then, by removing $c$ from the word, we obtain a good word in the $(n-1)$-letter alphabet (without the letter $c$). The length of this word will be at least $2 n+1=2(n-1)+3$, which contradicts the inductive hypothesis.

If the neighbors of the letter $c$ are the same, remove from the word $c$ and the letter before it; then at this "junction" will remain different letters. Therefore, we again obtain a good word in the $(n-1)$-letter alphabet, the length of which is at least $2(n-1)+2$; this is also impossible by the inductive hypothesis.

Comment. Only providing an example of a good word of $2 n+1$ letters - 1 point (this point can be combined with the points mentioned below).

Only proving that a good word has no more than $2 n+1$ letters - 6 points.

In proving this estimate, only proving that at most one letter appears more than twice - 2 points (out of 6); these points can be combined with points for the example.