We have to find the remainder of
$$32^{({32^{32}})}\mod 9$$
$\gcd(9,32)=1$ and by Euler's theorem we find $\phi(9)=9\cdot\frac{2}{3}=6$
Now
$$32\equiv5\mod 9 \ \\ 32 \equiv 2 \mod 6$$
$$\therefore32^{32}\equiv 2^{32}\mod 6$$
Now here comes a part where I am stuck. We know $2\equiv 2\mod 6$,
hence $2^{32}\equiv2^{32}\mod 6 \\ \Rightarrow 2^{31}\equiv (-1)^{31}\equiv 2\mod 3$
Now if I multiply both sides by $2$, then will it be $2^{32}\equiv4\mod 3$
or $2^{32}\equiv4\mod 6$?I know that $a\cdot c\equiv b\cdot c \mod m$ but we don't multiply $m$ with $c$. Here I am little confused.
But I know the method to solve the whole but I am stuck in this little area.
Please help me. Any help is appreciated.