Let $x$ be a $p$-letter word, $f^{n}(x)=x \implies x$ must be a 'boring' word Let $D$ be the set of permutation of $p$-letter word, where $p$ is prime number. And let $f$ be the function $f:D \rightarrow D$ that moves the last letter to the front. For example, if $p=7$,
$$ f(abcdefgh) = habcdefg  $$
We may call a word $x$ is a 'boring' word, only if $f(x) = x$. Notice that there exist only 26 boring words: all $a$s $\underbrace{aa...a}_{p}$, all $b$s, ..., and all $z$s $\underbrace{zz...z}_{p}$.
Proof that if $f^{n}(x) = x$, where $1 \le n \le p-1$, then $x$ is a 'boring' word.

My attempt, if $n=1$ is clear. Now let $p>2$, $n=2$ and $f^{2}(x)=x$. Define $\alpha_{i}$ to be the letter at position $i$th in $x$.
$$ x = \alpha_{1}, \alpha_{2}, ..., \alpha_{p} $$
$$ \implies f(x) = \alpha_{p}, \alpha_{1} , ..., \alpha_{p-1} $$
$$ \implies f^{2}(x) = \alpha_{p-1} , \alpha_{p}, ..., \alpha_{p-2} $$
This means that
$$ \alpha_{p} = \alpha_{p-2} = \alpha_{p-4} = ... = \alpha_{1} $$
but
$$ \alpha_{1} = \alpha_{p-1} = \alpha_{p-3} = ... = \alpha_{2} $$
so all the letters must be the same, which means a 'boring' word.
Now if $n > 2$ and $f^{n}(x)=x$. Notice that we always have $p = qn + r$, where $0<r<n$ is the remainder, then
$$ \alpha_{p} = \alpha_{p-n} =  ... = \alpha_{(p -qn) = r} $$
how to continue..?

Let $x=a_0\cdots a_{p-1}$ so $f^n(x)=a_{p-n}\cdots a_{p-1}a_0\cdots a_{p-n-1}$. By Lagrange we have $\langle p-n\rangle=\Bbb Z_p^+$ whenever $0<n<p$ and since $f^n(x)=x$ the result follows.
