# Alternating cipher

**Computer Science**Level pending

Suppose `RFMTD`

is encoded to `SENSE`

according to an **alternating** substitution, how is `MATH IS FUN`

encoded under the same cipher?

**Details**

- An alternating substitution \(M_n\) makes, for instance, the following mapping

\[\begin{align} M_2(\textrm{a})& \rightarrow \textrm{y} \\ M_2(\textrm{b})& \rightarrow \textrm{d} \\ M_2(\textrm{c})& \rightarrow \textrm{a} \\ M_2(\textrm{d})& \rightarrow \textrm{f} \\ M_2(\textrm{e})& \rightarrow \textrm{c} \\ &\ldots \\ M_2(\textrm{z})& \rightarrow \textrm{b} \end{align}\]

In general, \(n\) can be any integer, positive or negative.