Giant numbers#2673

Giant numbers

1 second
128 megabytes
Easy

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!

Input

Two numbers: (1 \leq n \leq 10^8) and (1 \leq k \leq 8) — the number of digits that Vasily needs.

Output

Print the last digits in one line (if any exist).

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading