Giant numbers
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
After the mathematician Vasily calculated the ending digits of 9^9
, he wanted to make a research on what numbers generally end the numbers of the form n^n
. Help him!
Input
Two numbers: n (1 ≤ n ≤ 10^8
) and k (1 ≤ k ≤ 8) - the number of digits that Vasily needs.
Output
Print k last digits in one line (if any exist).
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 853
Acceptance rate 17%