SCU 2010 warmup contest 5

B: Beautiful Palindromes