I have the following modular equation,
$$ (p + a) \mod 3 = m$$
which I want to solve for $a$. Of course, there are many valid values for $a$, but since I assume $m,p \in \{ 0, 1, 2\}$, I only want values of $a$ in that same range, in which case they would be unique. Is there a way to obtain an expression that gives me the value for $a$ in this range?