(define n (read)) (define m (read)) (if (= (modulo m 4) 0) (set! m 4) (set! m (modulo m 4))) (display (modulo (expt (modulo n 10) m) 10)) (newline)