SCU 2005' Warmup Contest 26

G: Last Digits