Work backwards. Given your remainder $r$ ($12$ in the example), make a "random" choice of $q$ and $m$, with $m\gt r$, and calculate $x=qm +r$. Then use $x\,\%\, m$.
Work backwards. Given your remainder $r$ ($12$ in the example), make a "random" choice of $q$ and $m$, with $m\gt r$, and calculate $x=qm +r$. Then use $x\,\%\, m$.