Martin has written a five-digit number with five different digits on a piece of paper, with the following properties:

- by crossing out the second digit from the left (i.e., the digit in the thousands place), he gets a number that is divisible by two,
- by crossing out the third digit from the left, he gets a number that is divisible by three,
- by crossing out the fourth digit from the left, he gets a number that is divisible by four,
- by crossing out the fifth digit from the left, he gets a number that is divisible by five,
- if he does not cross out any digit, the number is divisible by six.

What is the largest number Martin could have written on the paper?

(M. Petrová)
Let's denote the digits of Martin's number as $a, b, c, d, e$, and the number formed by them as $\overline{a b c d e}$. Now, let's analyze each of the five conditions:

1. The number $\overline{a c d e}$ is divisible by two, so the digit $e$ is $0, 2, 4, 6$, or 8,
2. The number $\overline{a b d e}$ is divisible by three, so the sum $a+b+d+e$ is divisible by three,
3. The number $\overline{a b c e}$ is divisible by four, so the number $\overline{c e}$ is divisible by four,
4. The number $\overline{a b c d}$ is divisible by five, so the digit $d$ is 0 or 5,
5. The number $\overline{a b c d e}$ is divisible by six, which means it is divisible by both two and three, i.e., the digit $e$ is even (which we already know from the first condition) and the sum $a+b+c+d+e$ is divisible by three.

Combining the second and fifth conditions, we get that the digit $c$ is also divisible by three. Therefore, the digit $c$ is $0, 3, 6$, or 9. We see that the digits $c, d, e$ are subject to individual conditions, while the digits $a$ and $b$ are not. When looking for the largest number that meets all conditions, we will sequentially check numbers created according to the following rules: we will build the number from left to right and always choose the largest possible digit such that the digits are distinct, the individual conditions for the digits $c, d, e$ are met, and no number has been checked before. To decide whether a thus created number meets all the given conditions, it is sufficient to verify the second and third conditions:

- 98654: the sum $9+8+5+4=26$ is not divisible by three (the second condition is not met),
- 98652: the sum $9+8+5+2=24$ is divisible by three (the second condition is met), but 62 is not divisible by four (the third condition is not met),
- 98650: the sum $9+8+5+0=22$ is not divisible by three (the second condition is not met),
- 98604: the sum $9+8+0+4=21$ is divisible by three (the second condition is met) and 64 is divisible by four (the third condition is also met).

Therefore, the number 98604 is the largest number that Martin could have written on the paper.