The first time I see such a "

*terrible*" implementation checks the mirror, but nevertheless. It's simple: this example compares the digits of numbers:

`a`

tens of thousands

`b`

thousands,

`with`

hundreds,

`d`

- tens

`e`

- units. Accordingly, if the discharge is

`a`

discharge equal to

`e`

, and also category

`b`

is equal to the discharge

`d`

, the number of the mirror, otherwise - no. How do you get the digits, respectively, dividing the number by 10000, 1000, 100 and 10 each time the next discharge is calculated from a modulo (

`%=`

)of the previous result, which every time put in

`integer`

`integer = 34543 a = 34543 / 10000 // = 3 integer = 34543 %= 10000 // = 4543 b = 4543 / 1000 // = 4 integer = 4543 %= 1000 // = 543 c = 543 / 100 // = 5 integer = 543 %= 100 // = 43 d = 43 / 10 // = 4 integer = 43 %= 10 // =3 e = 3 / 1 // = 3`