>>414
10^30 = 1000^10 ≡ (-2)^10 = 1024 ≡ 22 (mod 1002)