4. On the board, the product of the numbers $\overline{\text{IKS}}$ and $\overline{\text{KSI}}$ is written, where the letters correspond to different non-zero decimal digits. This product is a six-digit number and ends with S. Vasya erased all zeros from the board, after which IKS remained. What was written on the board?
Answer: $100602=162 \cdot 621$.

Solution. Let $p=\overline{\text { IKS }} \cdot \overline{\text { KSI }}$. In the decimal representation of $p$, there are three zeros, I, K, and S. Then the numbers $(I+K+S)^{2}$ and $(I+K+S)$ give the same remainders when divided by 9, from which $(I+K \text{ or } (I+K+S-1)) \vdots$. Since the number $I+K+S$ lies between 6 and 24, it belongs to the set $\{9,10,18,19\}$. The last digit S of the number $p$ is the remainder of the division of S$\cdot$I by 10. Therefore, $S \cdot(I-1) \vdots 10$. There are three possible cases.

1) $I=1$. Then $K+S \in\{8,9,17\}$. The second-to-last digit of the number $p$ is the remainder of the division of $S^{2}+K$ by 10. Since $S^{2}$ is not divisible by 10, this digit is different from K. Therefore, it is zero, from which

$$
\left(S^{2}+K\right) \vdots 10 \Longleftrightarrow\left(S^{2}-S+K+S\right) \vdots 10
$$

The remainders of the division of $S^{2}-S$ by 10 take only the values 0, 2, and 6. Therefore, $K+S=8$ and

$$
\left(S^{2}-S+8\right) \vdots 10 \Longleftrightarrow\left(S^{2}-S-2\right) \vdots 10 \Longleftrightarrow(S+1)(S-2) \vdots 10
$$

Since the digit $K$ is different from $S$ and 1, we get $S=2$ and $K=6$. This option works, since $162 \cdot 621=100602$.
2) $I=6$ and the digit $S$ is even. Then $K+S \in\{3,4,12,13\}$. By the condition, the leading digit of $p$ is I, that is, 6. Therefore,

$$
600000 \leqslant p \leqslant(I+1) \cdot(K+1) \cdot 10000=(K+1) \cdot 70000
$$

from which $K \geqslant 8$. Since $S$ is even, the pair $(K, S)$ is $(8,4)$ or $(9,4)$. This does not work, since $684 \cdot 846=578664$ and $694 \cdot 946=656524$.
3) $S=5$, and the digit I is odd and different from 1. Then $I+K \in\{4,5,13,14\}$. Since

$$
p<(I+1) \cdot(K+1) \cdot 10000 \leqslant 900000
$$

the leading digit of the number $p$ is less than 9, that is, $I \leqslant 7$. The case $I=5$ is impossible, since $I \neq S$. If $I=3$, then $K$ is 1 or 2, and the number $p$ turns out to be a five-digit number. If $I=7$, then $K=6$ due to the condition $K \neq I$. Since $765 \cdot 657=502605$, this case also does not work.