(defconstant +mod998+ 998244353) (defun %mod-expt (a n m) (let ((result 1)) (loop while (> n 0) when (oddp n) do (setq result (mod (* result a) m)) do (setq a (mod (* a a) m)) (setq n (ash n -1))) result)) (defun main (&rest argv) (declare (ignorable argv)) (let* ((a (read)) (n (read))) (format t "~d~%~d~%" +mod998+ (%mod-expt a n +mod998+)))) (main)