(while(print((rec(f x e m)(if(= e 1)x(mod(*(f(mod(* x x)m)(div e 2)m)(if(odd? e)x 1))m)))#0=(read)#0##0#)))