After the mathematician Vasily calculated the ending digits of 9^9, he wanted to research which numbers generally appear as the final digits of numbers in the form n^n. Help him!
Two numbers: (1 \leq n \leq 10^8) and (1 \leq k \leq 8) — the number of digits that Vasily needs.
Print the last digits in one line (if any exist).
Example 1
Example 2