eolymp
bolt
Try our new interface for solving problems
Problems

n^n mod 10^p

n^n mod 10^p

Given the values of \textbf{n} and \textbf{p}. Find \textbf{n^n mod p}. \InputFile Два целых числа \textbf{n} и \textbf{p} (\textbf{1 }≤ \textbf{n }≤ \textbf{10^9}, \textbf{1} ≤ \textbf{p} ≤ \textbf{100}). \OutputFile Вывести одно целое число \textbf{n^n mod 10^p}.
Time limit 1 second
Memory limit 64 MiB
Input example #1
3 1
Output example #1
7