TITLE: Find the last two digits of $12^{12^{12^{12}}}$ using Euler's theorem
QUESTION [8 upvotes]: I am supposed to find the last two digits of $12^{12^{12^{12}}}$ using Euler's theorem.
I've figured out that it would go as $12^{12^{12^{12}}} \mod{100}$.
But I really don't know how to progress from there. Any hints would be greatly appreciated.

REPLY [4 votes]: Using $\, ab\bmod ac = a(b\bmod c) = $ mod Distributive Law twice, and Euler $\phi,\,$ we have
$12^{\large 12^{\Large 4N}}\!\!\!\bmod 100 = 4\left[\dfrac{12^{\large\color{#c00} {12^{\Large 4N}}}}4\!\!\bmod 25\right]= 4\left[\dfrac{\color{#0a0}{12}^{\large\color{#c00}{16}}}4\!\!\bmod 25\right] =\,4\left[\dfrac{\color{#f76}{2^{\large 4}}}4\right] = 16,\, $ by
$\ \ \ \  \color{#c00}{12^{\large 4N}}\!\!\bmod\!\!\!\overbrace{20}^{\large \phi(25)}\!\!\! = 4\left[\dfrac{12^{\large 4N}}4\!\!\bmod 5\right] = 4[4]=\color{#c00}{16},\ $ by $\,\dfrac{2^{\large 4\:\!N}}4\equiv \dfrac{1^{\large N}}{-1}\equiv 4\pmod{\!5}$
$ \ \ \ \ \ \ \ \ \ \ \ \ \bmod 25\!:\,\ \underbrace{2^{\large 20}\!\equiv 1_{\!\!\!\!\!\!\phantom{1}}}_{\large \rm Euler\ \phi}\,\ $ & $\,\ 12\equiv \dfrac{-1}2\,\Rightarrow\, \color{#0a0}{12}^{\large\color{#c00}{ 16}}\equiv \dfrac{1}{2^{\large 16}}\equiv \dfrac{2^{\large 20}}{2^{\large 16}}\equiv \color{#f76}{2^{\large 4}}$
We used $\!\bmod 25\!:\ 12^{\color{#c00}K}\!\equiv 12^{K\bmod 20}$ by mod order reduction, by $12^{20}\equiv 1\,$ by Euler $\phi(25)\!=\!20$