SPOJ CLASSICAL LASTDIG. using Modular Exponentiation
SPOJ LASTDIGIT Modular Exponentiation