#P175. 【例29.2】 幂的末尾

【例29.2】 幂的末尾

Description

What are the last three digits of aba^b?

Input Format

Two positive integers aa and bb (1a1001≤a≤100, 1b100001≤b≤10000).

Output Format

Output the last three digits of the power from highest to lowest digit, without any separators. If the power has fewer than three digits, pad with leading zeros.

Sample

7 2011
743