Since 7 is coprime with 1000, by the Euler's theorem, , where is Euler's totient function. The last link shows that .

So, the first step is to find the remainder of and 400. I got 128. Next, we need to find the remainder of and 1000. I did the following: .