IIITD1 - Those College Days!


Once there was a Shikaari in IIIT Delhi campus and he was famous for his Shikaar techniques. Also there was Kalakhatta who was jealous of Shikaari’s charisma. Once Kalakhatta challenged Shikaari  to test his knowledge. Now Shikaari’s afraid of losing, would you help?


You are given a number N and you have to increment the Most Significant digit without changing any other number in N. You can do this by adding a positive number X.

Input

The first line of the input consist of a single integer number T which determines the number of tests.

In each of next t lines there is a single integer number N.


Constraints

  • 0 < t ≤ 105
  • | n |  ≤  109

Output

Print the minimum number X in separate lines.

Example

Input:
2
5
15
Output:
1
10 

hide comments
kooljais24: 2017-06-20 01:03:59

@stcsteven it's not mainly about the negetive sign as MSD.

TLE: 2017-06-14 11:25:09

Last edit: 2017-06-14 13:07:58
sharonbarak: 2017-06-10 19:13:35

Why is x = 3 for n = -1?

stcsteven: 2017-06-05 18:50:32

If n is -1 and the answer is 3, then does it mean if the number is negative, you would consider the negative mark as the MSD?

kasa_praneeth9: 2017-06-03 11:35:03


Last edit: 2017-06-03 12:02:29
[Rampage] Blue.Mary: 2017-05-31 16:35:15

What if n is -1/9/89/99?

Edit: then x is 3/1/10/10

Last edit: 2017-05-31 17:16:46
Vipul Srivastava: 2017-05-31 13:59:12

Last edit: 2017-05-31 14:05:47

Added by:deathgun
Date:2017-05-30
Time limit:0.200s-0.5s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All
Resource:Original