## On the Subject of the Variety CM

A machine that knows no bounds when it comes to ciphers.

Concatenate the digits displayed on the four large screens, in order, into a single number. Decoding this number involves an iterative process. In each iteration, a number n is relevant. Perform these calculations:

• Take the number modulo n to obtain a value.
• Divide the number by n (rounding down) to obtain the number for the next iteration.

First, apply the iteration with n equal to the number of letters in your encrypted word. The value obtained identifies which letter to decode, numbered from 0.

Next, apply the iteration with n = 3 and perform the following decoding depending on the number obtained:

• 0: Atbash. Turn the letter into its alphabetic position (A = 1, B = 2...Z = 26). Then take 27 minus the number to get a new number. Convert the number back to obtain the decrypted letter.
• 1: Caesar. Apply the iteration once more, this time with n = 25. Add 1 to the obtained value. Add this to the alphabetic position of the encrypted letter. If the resulting number is above 26, subtract 26 from it. Then convert the number back to obtain the decrypted letter.
• 2: Affine. Apply the iteration once more, this time with n = 12. Obtain a multiplier using the below table. Multiply the alphabetic position of the encrypted letter with this multiplier. If the resulting number is above 26, repeatedly subtract 26 from it until it is in range. Then convert the number back to obtain the decrypted letter.  Obtained value Multiplier 0 1 2 3 4 5 6 7 8 9 10 11 1 3 5 7 9 11 15 17 19 21 23 25

Afterwards, remove the letter from the encrypted word. Continue this process, each time with the reduced set of remaining letters.

The decrypted letters, in the other in which you decrypted them, form the decrypted word.

#### Example

Encrypted word: ILFO

Number = 327568

327568 % 4 = 0 (I)
327568 / 4 = 81892
81892 % 3 = 1 (Caesar)
81892 / 3 = 27297
27297 % 25 = 22
27297 / 25 = 1091
Caesar by 23: I → F
1091 % 3 = 2 (O)
1091 / 3 = 363
363 % 3 = 0 (Atbash)
363 / 3 = 121
Atbash: O → L
121 % 2 = 1 (F)
121 / 2 = 60
60 % 3 = 0 (Atbash)
60 / 3 = 20
Atbash: F → U
20 % 1 = 0 (L)
20 / 1 = 20
20 % 3 = 2 (Affine)
20 / 3 = 6
6 % 12 = 6
6 / 12 = 0
Affine by 15: L → X

Decrypted Word: FLUX