Each data set spans several lines. The first line holds two values. The first is an integer n between 1 and 5 that says how many data lines follow. The second is one of +, -, ^ and says which operation to perform. Each of the next n lines holds one data element, which is a positive integer, a positive real number, or a string of length at most 10.
Classify a data element by these rules.
1a, 12.34.56, .5, and 5. are strings.When the symbol is +, only integer elements produce a result. Print the sum of the digits of that integer.
When the symbol is -, only string elements produce a result. Print the string with every lowercase a deleted. An uppercase A stays.
When the symbol is ^, only real elements produce a result. Print that number in exponential form, built like this. Drop the decimal point, then strip leading and trailing zeros from the digit string to get the significant digits d1d2…dk, so the original value equals d1.d2…dk×10e. Write d1 when k is 1 and d1.d2…dk otherwise, then e, then the exponent e. A negative exponent carries a leading -, and a positive one carries no +. So 2.53 becomes 2.53e0, 25.3 becomes 2.53e1, 0.253 becomes 2.53e-1, and 1.000 becomes 1e0.
The first line contains the number of test cases T. The data for each test case follows.
The first line of a test case contains the number of data lines n (1≤n≤5) and one of the symbols +, -, ^, separated by a space. Each of the next n lines contains a positive integer, a positive real number, or a string of length at most 10. No data element contains whitespace.
Print one line per test case. The line starts with Case #x:, where x is the test case number counting from 1. After the prefix, print the results from the elements of the type the symbol selects, in input order, separated by one space, with one space between the prefix and the first result.
If no element is of that type, print the prefix alone with no trailing space. An empty result still holds its place, so the separating spaces around it are printed as usual.