Find the minimum number with the given sum of digits $s$ such that all digits in it are distinct (i.e. all digits are unique).

For example, if $s=20$, then the answer is $389$. This is the minimum number in which all digits are different and the sum of the digits is $20$ ($3+8+9=20$).

For the given $s$ print the required number.


-----Input-----

The first line contains an integer $t$ ($1 \le t \le 45$) — the number of test cases.

Each test case is specified by a line that contains the only integer $s$ ($1 \le s \le 45$).


-----Output-----

Print $t$ integers — the answers to the given test cases.


-----Examples-----

Input
4
20
8
45
10
Output
389
8
123456789
19


-----Note-----

None

Difficulty: EASY

Solutions:
t = int(input())
for i in range(t):
	num = int(input())
	reverse = ''
	sum1 = 0
	while sum1 != num:
		digits = '987654321'
		for x in digits:
			if sum1 + int(x) > num:
				digits = digits[digits.index(x) + 1:len(digits)]
			else:
				digits = digits[digits.index(x) + 1:len(digits)]
				reverse += str(x)
				sum1 += int(x)
	real = ''
	for y in range(-1, -1 * (len(reverse) + 1), -1):
		real += reverse[y]
	print(int(real))


for i in range(int(input())):
	x = int(input())
	s = ''
	for i in range(9, 0, -1):
		if x - i == abs(x - i):
			x = x - i
			s = str(i) + s
	print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	a = 9
	s = ''
	cnt = 20
	while n > 0 and cnt > 0:
		cnt -= 1
		s += str(min(a, n))
		a -= 1
		n -= int(s[-1])
	print(s[::-1])


t = int(input())
for i in range(t):
	s = int(input())
	L = []
	i = 0
	while s > 0:
		if s >= 9 - i:
			s -= 9 - i
			L.append(9 - i)
			i += 1
		else:
			L.append(s)
			s = 0
	L.reverse()
	M = [str(x) for x in L]
	print(''.join(M))


t = int(input())
for c in range(t):
	n = int(input())
	ans = list()
	digitos = [1, 2, 3, 4, 5, 6, 7, 8, 9]
	while n > 0:
		dec = min(n, digitos[-1])
		digitos.remove(dec)
		ans.append(dec)
		n = n - dec
	output = ''
	for c in range(len(ans) - 1, -1, -1):
		output += str(ans[c])
	print(output)


test = int(input())
while test > 0:
	test -= 1
	n = int(input())
	if n <= 9:
		print(n)
	else:
		t = ''
		temp = 9
		while n > 0 and temp > 0:
			if n - temp >= 0:
				t += str(temp)
				n -= temp
			temp -= 1
		print(t[::-1])


t = int(input())
for i in range(t):
	s = int(input())
	k = s
	p = []
	if s < 10:
		p.append(s)
		s = 0
	else:
		m = 9
		while s > m:
			s -= m
			p.append(m)
			m -= 1
	p.append(s)
	x = ''.join([str(i) for i in p[::-1]])
	print(int(x))


for _ in range(int(input())):
	n = int(input())
	s = ''
	k = 9
	while n and k > 0:
		if k <= n:
			n -= k
			s += str(k)
			k -= 1
		else:
			k -= 1
	s = s[::-1]
	print(s)


cases = int(input())

def get_num(num, arr, current_num=9):
	if num < 10 and num not in arr:
		return num
	arr.append(current_num)
	return current_num + 10 * get_num(num - current_num, arr, current_num=current_num - 1)
while cases:
	res = get_num(int(input()), [])
	print(res)
	cases -= 1


testcases = int(input())
for i in range(testcases):
	split_num = int(input())
	split_list = []
	while split_num >= 10:
		for j in range(9, 0, -1):
			if j not in split_list:
				split_list.append(j)
				split_num -= j
				if split_num in split_list:
					continue
				break
	split_list.append(split_num)
	final_list = ''
	for a in split_list:
		a = str(a)
		final_list += a
	print(final_list[::-1])


def solution(n):
	nums = [1, 2, 3, 4, 5, 6, 7, 8, 9]
	outs = []
	while n > 0:
		num = nums.pop()
		if n >= num:
			n -= num
			outs.append(num)
	return ''.join(map(str, outs[::-1]))
t = int(input())
msgs = []
for _ in range(t):
	n = int(input())
	msgs.append(f'{solution(n)}')
print('\n'.join(msgs))


for s in [*map(int, open(0))][1:]:
	r = ''
	i = 9
	while s:
		while i > s:
			i -= 1
		if i:
			s -= i
			r = str(i) + r
		i -= 1
	print(r)


t = int(input())
for i in range(t):
	s = int(input())
	ans = 0
	if s < 10:
		ans = s
	else:
		i = 9
		while i > 0:
			if s >= i:
				ans = i * 10 ** (9 - i) + ans
				s = s - i
				i -= 1
			else:
				ans = s * 10 ** (9 - i) + ans
				break
	print(ans)


def solve():
	v = [''] * 46
	v[1] = '1'
	v[2] = '2'
	v[3] = '3'
	v[4] = '4'
	v[5] = '5'
	v[6] = '6'
	v[7] = '7'
	v[8] = '8'
	v[9] = '9'
	c = 10
	l = 9
	b = '9'
	while c <= 45:
		a = 1
		while a < l:
			v[c] = b + str(a)
			c += 1
			a += 1
		b += str(l - 1)
		l -= 1
	t = int(input())
	for _ in range(t):
		q = int(input())
		print(v[q][::-1])
solve()


for _ in range(int(input())):
	n = int(input())
	a = ''
	for i in range(9, 0, -1):
		if n >= i:
			a = str(i) + a
			n -= i
	a = str(n) + a
	print(int(a))


def summa(s, n, k, q):
	for j in range(1, 10):
		n[k] = j
		if sum(n) == s or j == q:
			return j
		else:
			continue
t = int(input())
for i in range(t):
	s = int(input())
	if s <= 9:
		print(s)
	else:
		m = 9
		q = 8
		n = [0] * m
		n[0] = m
		for k in range(1, 9):
			if s != m:
				p = summa(s, n, k, q)
				q = q - 1
				m = m + p
			else:
				break
		for r in range(8, -1, -1):
			if n[r] == 0:
				del n[r]
		n = sorted(n)
		u = len(n)
		w = 0
		for v in range(u):
			w = w + n[v] * 10 ** (u - v - 1)
		print(w)


def get_min_number(s):
	res = 0
	i = 9
	k = 0
	while s > 0:
		if s - i >= 0:
			res = i * 10 ** k + res
			s -= i
		else:
			res = s * 10 ** k + res
			s = 0
		k += 1
		i -= 1
	return res

def solve():
	s = int(input())
	print(get_min_number(s))
for _ in range(int(input())):
	solve()


for _ in range(int(input())):
	s = int(input())
	if 1 <= s < 10:
		print(s)
	elif 10 <= s < 18:
		print(10 * (s - 9) + 9)
	elif 18 <= s < 25:
		print(100 * (s - 17) + 89)
	elif 25 <= s < 31:
		print(1000 * (s - 24) + 789)
	elif 31 <= s < 36:
		print(10000 * (s - 30) + 6789)
	elif 36 <= s < 40:
		print(100000 * (s - 35) + 56789)
	elif 40 <= s < 43:
		print(1000000 * (s - 39) + 456789)
	elif 43 <= s < 45:
		print(10000000 * (s - 42) + 3456789)
	elif s == 45:
		print(123456789)


t = int(input())
for i in range(t):
	x = int(input())
	l = 9
	c = 1
	j = 0
	while x // l != 0 and l != 1:
		x -= l
		j = c * l + j
		l -= 1
		c *= 10
	l = x
	j = c * l + j
	print(j)


def ans(n):
	x = n
	if n < 10:
		return n
	i = 9
	while n >= 3:
		n = n - i
		if n < 0:
			n = n + i
			break
		i -= 1
	while i < 9:
		n = n * 10 + i + 1
		i += 1
	return n
r = []
T = int(input())
for _ in range(T):
	n = int(input())
	c = ans(n)
	r.append(c)
for i in range(T):
	print(r[i])


t = int(input())
for i in range(t):
	s = int(input())
	if s < 10:
		x = s
	else:
		for j in range(10):
			if s > 45 - j * (j + 1) / 2:
				break
		x = int(s - 45 + j * (j + 1) / 2)
		for k in range(j + 1, 10):
			x = x * 10 + k
	print(x)


n = int(input())
r = []

def m(n):
	if n == 0:
		return 9
	else:
		return n - 1
for i in range(n):
	s = int(input())
	k = 9
	nn = ''
	while s > 0:
		if s <= 9 and str(s) not in nn:
			nn = nn + str(s)
			break
		if str(k) not in nn:
			nn = nn + str(k)
			s -= k
			k = m(k)
		else:
			while k in nn:
				k = m(k)
				s -= k
				nn = nn + str(k)
	r.append(nn[::-1])
for j in r:
	print(j)


for _ in range(int(input())):
	n = int(input())
	s = ''
	m = 9
	while n > 0:
		if n > m:
			n -= m
			s = str(m) + s
			m -= 1
		else:
			s = str(n) + s
			break
	print(s)


t = int(input())
for _ in range(t):
	s = int(input())
	sol = ''
	summ = 0
	for i in range(9, 0, -1):
		if summ + i <= s:
			sol = str(i) + sol
			summ = summ + i
	print(sol)


for _ in range(int(input())):
	n = int(input())
	c = 9
	ans = ''
	while n > c:
		ans = str(c) + ans
		n -= c
		c -= 1
	ans = str(n) + ans
	print(int(ans))