Doodle Girl

5

1 votes
Easy
Problem

Twinkle loves number theory questions, but since winter is coming, her "doodle" has increased considerably so she prefers a shorter way to do everything. She has a number N , now she wants you to help her in solving a task which she thought of doing this week. Compute the sum of digits and print the summation if the the summation is prime , otherwise print the number N .

INPUT

The first line of the test case contains an integer T, denoting number of test cases. The following T lines contains one integer representing the number N.

Output

Print the answer for every test case in separate line.

Constraints

1<=T<=1000

10<=N<=10^6

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

1+8+9+7=25 , 25 is not a prime , hence print the number 1897. 6+1=7 7 is a prime number , hence print the summation that is 7.

Editor Image

?