(define (System.out.println x) (begin (display x) (newline) ) ) (let ( (N (read)) (M (read)) ) (System.out.println (modulo (expt (modulo N 10) (modulo M 10)) 10)) )