The last digits of a power repeat, so a huge exponent only matters through its remainder by the cycle length.