Problem hidden

INUMBER - Interesting number

For the given number n find the minimal positive integer divisible by n, with the sum of digits equal to n.

Input

t – the number of test cases, then t test cases follow. (t ≤ 50)
Test case description:
n - integer such that 0 < n ≤ 1000

Output

For each test case output the required number (without leading zeros).

Example

Input:
2
1
10

Output:
1
190

Adicionado por:Roman Sol
Data:2005-01-13
Tempo limite:7s
Tamanho do fonte:4096B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Linguagem permitida:Todas exceto: ASM64 CLOJURE ERL FSHARP PERL6 PY_NBC SCALA TCL
Origem:XII team championship of St.-Petersburg in programming
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.