result
current_power
a
b
d
result = (result * (current_power^d mod 1337)) mod 1337
(current_power^10) mod 1337