Problems
Giant numbers
Giant numbers
After the mathematician Vasily calculated the ending digits of 99
, he wanted to make a research on what numbers generally end the numbers of the form nn
. Help him!
Input
Two numbers: n (1 ≤ n ≤ 108
) and k (1 ≤ k ≤ 8) - the number of digits that Vasily needs.
Output
Print k last digits in one line (if any exist).
Input example #1
3 3
Output example #1
27
Input example #2
14 3
Output example #2
016