Compute the inverse of 999 modulo 1000. Express your answer as an integer from 0 to 999.
999*-1 = 1000*-1+1
So the inverse is -1
but you want an integer from 0 to 999 so
1000-1 = 999
the inverse of 999 mod 1000 is 999
check
999*999=998001 = 1 (mod1000)