I want to find out what is$$2007^{2008}\pmod{1000}$$.
I used this website to find that the answer is $801$, but I'm not sure how they got there.
My attempt:
$2007^{2008}\pmod{1000}\equiv7^{2008}\pmod{1000}\equiv2401^{502}\pmod{1000}\equiv401^{502}\pmod{1000}\equiv160801^{251}\pmod{1000}\equiv801^{251}\pmod{1000}$
I pretty much gave up after this because it was getting too tedious and I didn't feel like this was the right approach. I got the $801$ but it has a power of $251$ which I don't know how to get rid of. Is there a quicker way to do this? If so, how? Thanks in advance!