SCU 2006 Warmup Contest 10

B: Best SMS to Type