and $ s_2 $ are accepting states; $ s_3 $ and $s_4$ are rejecting states; and $s_5$ is the only neutral state. After reading $ {\mbox{\textcent}}$, the affine state is set to $ v_1 = (0~~0~~1~~0~~0)^T $. Remember that $ e(u) $ denotes the encoding of the string $ u \in \{1,2\}^* $ in base-3.

We apply the following operators when reading symbols 1 and 2: $$M_1 = {\left( \begin{array}{rrrrr} 4 & 1 & 1 & 1 & 1 \\ 0 & 1 & 1 & 0 & 0 \\ 0 & 0 & 3 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ -3 & ~ -1 & ~ -4 & ~ -1 & ~~~ 0 \end{array} \right)}
    \mbox{ and }
    M_2 = {\left( \begin{array}{rrrrr} 5 & 2 & 2 & 2 & 2 \\ 0 & 1 & 2 & 0 & 0 \\ 0 & 0 & 3 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\  -4 & ~ -2 & ~ -6 & ~ -2 & ~-1 \end{array} \right)}$$ that encode strings $ u $ and $ u^r $ into the values of 