In the word PAMPELIŠKA, the same letters are to be replaced by the same non-zero digits, and different letters by different non-zero digits. Moreover, it must hold that the product of the digits of the resulting number is the square of some natural number. Find the largest number that can be obtained by replacing the letters under the given conditions.

(E. Patáková)
In the word PAMPELIŠKA, there are 8 different letters. We are allowed to use only non-zero digits, so we choose eight digits from the nine possible ones. The product

$$
P^{2} \cdot A^{2} \cdot M \cdot E \cdot L \cdot I \cdot \check{S} \cdot K
$$

should be a square of a natural number. Since the digits $P$ and $A$ are squared in the product, it is sufficient to ensure that the product

$$
M \cdot E \cdot L \cdot I \cdot \check{S} \cdot K
$$

is a square of a natural number, meaning that all prime numbers in its prime factorization should be in even powers. Let's consider which factors we can substitute:

| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| 1 | 2 | 3 | $2 \cdot 2$ | 5 | $2 \cdot 3$ | 7 | $2 \cdot 2 \cdot 2$ | $3 \cdot 3$ |

The digits 5 and 7 cannot be used in the product (1) because we have no way to complete them to a square. The number that results from replacing the letters in the word PAMPELIŠKA should be as large as possible, so we try to substitute the largest values for $P, A, M$ etc. step by step.

If we choose $P = 9$, the remaining six digits for the product (1) are $8, 6, 4, 3, 2, 1$. After substitution, this product results in $2^{7} \cdot 3^{2}$, which does not meet the above requirement.

If we choose $P = 8$, the remaining six digits for the product (1) are $9, 6, 4, 3, 2, 1$, which after substitution gives $2^{4} \cdot 3^{4}$, which meets the above requirement. We substitute these digits for $M, E, L, I, \check{S}, K$ in descending order. For $A$, the remaining digits are 5 or 7 — we choose the larger one. The desired number is

$$
8798643217 \text {. }
$$

Evaluation. 2 points for noting that the numbers 5 and 7 cannot be in the product (1); 2 points for justifying that $P = 8$ should be chosen; 2 points for the final number.