CodeLab Academy 📞 9936 6696
← List Python · Level 10: Algorithms Code · 100 points ← #974 #976 →

#975. Fast power (mod 1000)

You get a and b (b can be very big). Find aᵇ mod 1000 using fast exponentiation. ### Input One line: a b (0 ≤ a ≤ 10⁹, 0 ≤ b ≤ 10¹⁸). ### Output A number.

Examples

Input
371436559 82402091877596196
Output
241
Input
733669769 651066763784896064
Output
121

💡 You can solve it with Python, JavaScript or blocks. Read the input line by line with input(). Don't print a question (like input("Number: ")). Print exactly what the output asks for, nothing more.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!