A straddling number is a natural number in which

- each non-zero digit is used exactly twice,
- between two identical non-zero digits, there are exactly as many zeros as the value of those digits.

Examples of straddling numbers include 40001041 and 300103100.

How many seven-digit straddling numbers exist, in which only ones, twos, and zeros appear in their notation?

Hint. How many times are zeros used in each of the sought numbers?
The sought numbers are seven-digit and contain exactly two ones and exactly two twos, i.e., they contain exactly three zeros. These zeros separate four parts in the number, where ones and twos can be located:

$$
\text { . . . } 0 \text {. . . . . . . . } 0 \text {. }
$$

Some parts may remain empty, and some zeros may be adjacent to each other. Ones can only be in neighboring parts (separated by one zero), and twos can be in parts separated by two zeros. All numbers with these properties that do not start with zero are listed in the following table:

|  | $.1 .0 .1 .0 \ldots 0 \ldots$ | $\ldots 0.1 .0 .1 .0 \ldots$ | $\ldots 0 \ldots 0.1 .0 .1$ |
| :---: | :---: | :---: | :---: |
| $.2 .0 \ldots . \stackrel{2}{*} 0 \ldots$ | 1201020,2101020 | 2010120,2010210 | 2001201,2002101 |
| $\ldots 0.2 .0 \ldots 0.2$ | 1012002,1021002 | - | - |

There are eight such numbers with the given properties.

Note. Part of the task is also to describe the process leading to the correct answer. In this case, it involves some system to ensure that nothing is forgotten. Simply listing the possibilities without proper justification cannot be rated at the highest level.