Substitution cipher transformation in the alphabet $A=\left\{a_{1}, a_{2}, \ldots, a_{n}\right\}$, consisting of p different letters, involves replacing each letter of the plaintext with a letter from the same alphabet, with different letters being replaced by different letters. The key for a simple substitution cipher is a table that specifies which letter should replace each letter of the alphabet A. If the word СРОЧНО is encrypted using simple substitution with the key:

| $\mathrm{A}$ | Б | $\bar{B}$ | $\Gamma$ | Д | $\mathrm{E}$ | K |  | 3 |    И  | $\mathrm{K}$ $Л$ | $\mathrm{M}$ | $\mathrm{H}$ | $\mathrm{O}$ | $\Pi$ |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| $Ч$ | Я | Ю |  | b | b | Щ |  | Ш | Ц | $\Phi$ | $\mathrm{y}$ | Б | Д | $\vec{T}$ |
| $\bar{P}$ | $\bar{C}$ | $\mathrm{~T}$ | $\bar{y}$ | $\Phi$ | $\mathrm{X}$ | Ц | Ч | III | Щ | b | $\mathrm{bI}$ | $\ni$ | $\mathrm{O}$ |  |
| 3 | B | $\mathrm{P}$ | $\Pi$ | $\mathrm{M}$ | $\Pi$ | $\mathrm{K}$ | $\mathrm{A}$ | И | $\mathrm{O}$ | K | $\mathrm{E}$ | C | $\Gamma$ | H |

then the word ВЗДАБД is obtained. Encrypting the resulting word using the same key again, we get the word ЮШЫЧЯЫ. How many different words can be obtained if the specified encryption process is continued indefinitely?
The number of different words that can be obtained in the specified encryption process with the initial word СРОЧНО coincides with the smallest cycle number of encryption that gives this initial word.

## Solution

Since different letters are replaced by different ones, different words are obtained when encrypting different words. On the other hand, identical letters are replaced by identical ones, so identical words result in identical words. Thus, the number of different words that can be obtained in the specified encryption process with the initial word СРОЧНО coincides with the smallest cycle number of encryption that gives this initial word. Since the letter С repeats in every encryption cycle whose number is a multiple of 5, and the letters Р, О, Ч, Н - in every cycle whose numbers are multiples of 13, 7, 2, and 3, respectively, the word СРОЧНО will first appear in a cycle with a number equal to $\operatorname{LCM}(2,3,5,7,13)=2730$.

## Answer

2730 words.