Ugly Problem

Time Limit: 1000ms
Memory Limit: 65536KB
This problem will be judged on HDU. Original ID: 5920
64-bit integer IO format: %I64d      Java class name: Main
Special Judge

Description

Everyone hates ugly problems.

You are given a positive integer. You must represent that number by sum of palindromic numbers.

A palindromic number is a positive integer such that if you write out that integer as a string in decimal without leading zeros, the string is an palindrome. For example, 1 is a palindromic number and 10 is not.

Input

In the first line of input, there is an integer T denoting the number of test cases.

For each test case, there is only one line describing the given integer s ($1\leq s \leq 10^{1000}$).

Output

For each test case, output “Case #x:” on the first line where x is the number of that test case starting from 1. Then output the number of palindromic numbers you used, n, on one line. n must be no more than 50. 阤n output n lines, each containing one of your palindromic numbers. Their sum must be exactly s.

Sample Input

2
18
1000000000000

Sample Output

Case #1:
2
9
9
Case #2:
2
999999999999
1

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .