In what concerns the continuous evaluation solving exercises grade during the semester, you should submit until 23:59 of March 24th
(this exercise will still be available for submission after that deadline, but without couting towards your grade)
[to understand the context of this problem, you should read the class #03 exercise sheet]


[PII019] Sum me up!

Have you ever looked at a number and thought, "What if I could just add up all its digits and see what I get?"

The Problem

Write a program that, given several integers, calculates the sum of the digits of each one. For example, if the input number is 123, the output should be 1 + 2 + 3 = 6.

Input

The first line of input contains an integer T, representing the number of test cases that follow.

Each of the following T lines contains one integer N, representing the number that we want to sum the digits.

Output

The output should have exactly T output lines, one per input test case.

Each of these lines should contain the respective digit sum.

Constraints

The following limits are guaranteed in all the test cases that will be given to your program:

1 ≤ T ≤ 10       Number of test cases
1 ≤ N ≤ 109       Number for which we want to sum the digits

Example Input Example Output
4
42
1234
789
16250301
6
10
24
18

Explanation of Example


Programming II (CCINF1002)
DCC/FCUP - University of Porto