<s>[INST] Calculate remainder of $12^{34^{56^{78}}}$ when divided by $90$ 
Calculate remainder of $12^{34^{56^{78}}}$ when divided by $90$

First of all,I'm not sure about the order of calculation of powers!
Secondly I don't know the rules of finding remainder moulus 90
 [/INST] My solution is rather routine and makes good use of Euler totient theorem and modulus properties.
$$\begin{align*}12^{34^{45^{78}}} \pmod{90} &\equiv 6\left[\frac{12^{34^{45^{78}}}}{6} \pmod{15} \right],\qquad\qquad\gcd(12,90)=6\\
&\equiv 18\left[\frac{12^{34^{45^{78}}}}{18} \pmod{5}\right],\qquad\qquad\gcd(12,15)=3\\
&\equiv 18\left[\frac{2^{34^{45^{78}}\pmod 4}}{3} \pmod{5}\right],\qquad\qquad\phi(5)=5-1=4\\
&\equiv 18\left[\frac{2^0}{3} \pmod{5}\right]\\
&\equiv 18\left[\frac{6}{3} \pmod{5}\right]\\
&\equiv 18\left[2\right]\equiv 36
\end{align*}$$
</s>