When calculating $7777^{5555} \pmod{191}$, we first note that $gcd(7777,191)=1$ and $\phi(191)=190$. We can indeed use Euler's theorem:
$$
7777^{190}\equiv 1 \pmod{191}
$$
and therefore
$$
777^{5555} = 7777^{190 \times 29} 7777^{45} \equiv 1^{29} \times 7777^{45} \pmod{191} = 7777^{45} \pmod{191}
$$
Now that the exponent is much smaller, we can use repeated squaring. First we note that $45= 1 + 4 + 8 + 32$, and
- $7777\equiv 137 \pmod{191}$
- $7777^{2}\equiv 137^2 \equiv 51 \pmod{191}$
- $7777^{4} \equiv 137^4 \equiv 51^2 \equiv 118 \pmod{191}$
- $7777^{8} \equiv 118^2 \equiv 172 \pmod{191}$
- $7777^{32} \equiv 118^8 \equiv 59 \pmod{191} $
and therefore
$$
7777^{45} \equiv 137\times 51 \times 118\times 172\times 59 \equiv 76 \pmod{191}
$$