Read problem statements in [Hindi], [Bengali], [Mandarin Chinese], [Russian], and [Vietnamese] as well.

Guddu likes a girl that loves playing with numbers. She agreed to go on a date with Guddu, but only if he can solve the following problem:

An integer is *round* if it is greater than $0$ and the sum of its digits in decimal representation is a multiple of $10$. Find the $N$-th smallest round integer.

However, Guddu does not like playing with numbers at all and he is unable to solve this problem, so he begs you to solve it for him. In return, he will definitely give you a treat.

------  Input ------
The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
The first and only line of each test case contains a single integer $N$.

------  Output ------
For each test case, print a single line containing the $N$-th round integer. It is guaranteed that this number is smaller than $2^{64}$.

------  Constraints ------
$1 ≤ T ≤ 10^{5}$
$1 ≤ N ≤ 10^{18}$

------  Subtasks ------
Subtask #1 (30 points):
$1 ≤ T ≤ 10$
$1 ≤ N ≤ 10^{5}$

Subtask #2 (70 points): original constraints

----- Sample Input 1 ------ 
1

2
----- Sample Output 1 ------ 
28
----- explanation 1 ------ 
Example case 1: The smallest round integer is $19$ and the second smallest is $28$.

Difficulty: MEDIUM

Starter code:

Solutions:
t = int(input())
for _ in range(t):
	n = int(input())
	ans = str(n)
	s = 0
	for i in ans:
		s += int(i)
		s = s % 10
	print(ans + f'{(10 - s) % 10}')


import os, sys, io, math
from re import *
from math import *
from array import *
from heapq import *
from bisect import *
from functools import *
from itertools import *
from statistics import *
from collections import *
I = lambda : [*map(int, sys.stdin.readline().split())]
IP = lambda : map(int, input().split())
IS = lambda : input()
IN = lambda : int(input())
IF = lambda : float(input())

def f():
	n = IS()
	s = 0
	for i in n:
		s += int(i)
	if s % 10 == 0:
		return n + '0'
	return n + str(10 - s % 10)
for _ in range(IN()):
	print(f())


t = int(input())
for i in range(t):
	s = input()
	ans = 0
	for j in s:
		ans = ans + int(j)
	if ans % 10 == 0:
		div = ans // 10
	else:
		div = ans // 10 + 1
	div = div * 10
	ans = div - ans
	print(s + str(ans))


t = int(input())
for i in range(t):
	n = input()
	s = 0
	for i in range(len(n)):
		s += int(n[i])
	if s % 10 == 0:
		print(int(n + '0'))
	else:
		print(int(n + str(10 - s % 10)))


for _ in range(int(input())):
	N = input()
	digits = list(map(int, list(N)))
	print(N + str((10 - sum(digits) % 10) % 10))


tests = int(input())
for i in range(tests):
	num = int(input())
	temp = num
	num_total = 0
	while temp != 0:
		num_total += temp % 10
		temp //= 10
	if num_total % 10 != 0:
		diff = 10 - num_total % 10
	else:
		diff = 0
	print(str(num) + str(diff))


NUMSIZE = 20

def inc(num):
	for i in range(NUMSIZE - 1, -1, -1):
		if num[i] < 9:
			num[i] = num[i] + 1
			break
		else:
			num[i] = 0
			continue

def main(n):
	num = listofzeros = [0] * NUMSIZE
	cnt = 0
	for i in range(pow(10, NUMSIZE) - 1):
		inc(num)
		if sum(num) % 10 == 0:
			cnt = cnt + 1
			if cnt == n:
				return int(''.join(map(str, num)))

def fast(n):
	rest = sum(map(int, str(n))) % 10
	if rest == 0:
		return int(str(n) + '0')
	else:
		return str(n) + str(10 - rest)
for i in range(int(input())):
	print(fast(int(input())))


for _ in range(int(input())):
	N = int(input())
	sum_of_digits_N = 0
	A = str(N)
	for ele in A:
		sum_of_digits_N += int(ele)
	last_digit = 10 - sum_of_digits_N % 10
	if last_digit == 10:
		last_digit = 0
	A = A + str(last_digit)
	print(int(A))


t = int(input())
for _ in range(t):
	n = int(input())
	k = n
	num = 0
	while n > 0:
		last = n % 10
		n = n - last
		n = n // 10
		num = num + last
	if num % 10 == 0:
		print(str(k) + str(0))
	else:
		print(str(k) + str(10 - num % 10))


t = int(input())
while t != 0:
	N = input()
	digits = list(map(int, list(N)))
	print(N + str((10 - sum(digits) % 10) % 10))
	t -= 1


T = int(input())

def sum(n):
	s = 0
	while n > 0:
		s += n % 10
		n = n // 10
	return s
for i in range(0, T):
	N = int(input())
	s = sum(N)
	d = s % 10
	r = 10 - d
	num = N * 10 + r % 10
	print(num)


for _ in range(int(input())):
	n = int(input())
	m = sum((int(x) for x in str(n)))
	rem = m % 10
	if rem == 0:
		print(str(n) + '0')
	else:
		print(str(n) + str(10 - rem))


t = int(input())
for _ in range(t):
	n = int(input())
	copy = n
	sumOFdigits = 0
	while copy != 0:
		digit = copy % 10
		sumOFdigits += digit
		copy //= 10
	mod = sumOFdigits % 10
	print(n * 10 + (10 - mod) % 10)


for _ in range(int(input())):
	N = int(input())
	s = lambda n: sum([int(x) for x in str(n)])
	add = 0 if not s(N) % 10 else 10 - s(N) % 10
	print(10 * N + add)


import math as m
t = int(input())
for _ in range(t):
	n = int(input())
	copy = n
	sumOFdigits = 0
	while copy != 0:
		digit = copy % 10
		sumOFdigits += digit
		copy //= 10
	mod = sumOFdigits % 10
	print(n * 10 + (10 - mod) % 10)


from bisect import bisect_left, bisect_right
import math
from sys import maxsize
from collections import defaultdict
from bisect import bisect_left
from heapq import heapify, heappush, heappop
from collections import deque
import sys
from math import gcd, sqrt, log10, log2, floor, ceil, sqrt
from collections import deque, defaultdict
input = sys.stdin.readline

def il():
	return [int(a) for a in input().strip().split()]

def ip():
	return input().strip()

def ii():
	return int(input())

def ot(in_p, *args, e=' '):
	if type(in_p) == list:
		print(*in_p, end=e)
	if type(in_p) == str or type(in_p) == int:
		print(in_p, end=e)
		for l in args:
			print(l, end=e)
	print()

def a_pwr_n(a, n, mod):
	if n == 1:
		return a % mod
	if n % 2 == 0:
		val = a_pwr_n(a, n // 2, mod)
		return val % mod * val % mod
	else:
		return a % mod * a_pwr_n(a, n - 1, mod) % mod

def rg(*ag):
	if len(ag) == 3:
		return range(ag[0], ag[1], ag[2])
	elif len(ag) == 2:
		return range(ag[0], ag[1])
	elif len(ag) == 1:
		return range(ag[0])
	else:
		raise 'invalid input'

def ispal(i, j, st):
	while i <= j:
		if st[i] == st[j]:
			i = i + 1
			j = j - 1
		else:
			return False
	return True
mod = 1000000000 + 7
dx = [-1, -2, 1, 2, 2, -2, -1, 1]
dy = [2, 1, 2, 1, -1, -1, -2, -2]
for _ in range(ii()):
	n = ip()
	xd = 0
	for i in n:
		xd += int(i)
	if xd % 10 > 0:
		xd = 10 - xd % 10
	else:
		xd = 0
	print(int(n) * 10 + xd)


for _ in range(int(input())):
	n = int(input())
	m = n
	s = 0
	while m > 0:
		s += m % 10
		m //= 10
	near = s + 10 - (s + 10) % 10
	a = near - s
	if s % 10 == 0:
		print(str(n) + '0')
		continue
	print(str(n) + str(a))


for _ in range(int(input())):
	n = int(input())
	m = n
	sume = 0
	while n:
		sume += n % 10
		n //= 10
	nearest = sume + 10 - (sume + 10) % 10
	ans = nearest - sume
	if sume % 10 == 0:
		print(str(m) + '0')
		continue
	print(str(m) + str(ans))


for _ in range(int(input())):
	n = int(input())
	for i in range(10 * n, 10 * (n * n)):
		num = i
		x = [int(a) for a in str(num)]
		if sum(x) % 10 == 0:
			print(i)
			break


def date(n):
	a = []
	b = str(n)
	for i in b:
		a.append(int(i))
	return sum(a)
a = int(input())
for i in range(a):
	N = int(input())
	b = date(N)
	c = b % 10
	s = str(N)
	if c == 0:
		e = s + '0'
	else:
		d = 10 - c
		e = s + str(d)
	print(e)


def digsum(n2, e):
	num = n2 % e
	sum1 = 0
	while num != 0:
		rem = num % 10
		sum1 = sum1 + rem
		num = num // 10
	return sum1
e = 2 ** 64
n = int(input())
for i in range(n):
	n1 = int(input())
	cnt = 0
	k = (n1 + 1) * 10 % e
	for l in range(k - 1, 10, -1):
		x = digsum(l, e)
		x = x % e
		if x % 10 == 0:
			print(l)
			break


for _ in range(int(input())):
	n = int(input())
	s = str(n)
	sum1 = 0
	for j in range(len(s)):
		sum1 += int(s[j])
	y = sum1 % 10
	s = s + str((10 - y) % 10)
	print(s)


def rsof_dig(x):
	s = 0
	y = len(x)
	for index in range(0, y):
		s += int(x[index])
		a = s % 10
		b = 0 if a == 0 else 10 - a
	return b

def main():
	tsc = int(input())
	for i in range(0, tsc):
		string = input()
		p = int(string) * 10 + rsof_dig(string)
		print(p)
main()


try:
	for _ in range(int(input())):
		n = int(input())
		sumOfDigits = 0
		temp = n
		while temp != 0:
			digit = temp % 10
			sumOfDigits += digit
			temp //= 10
		mod = sumOfDigits % 10
		a = (10 - mod) % 10
		print(n * 10 + a)
except:
	pass


def sumdg(n):
	sm = 0
	while n:
		sm += n % 10
		n //= 10
	return sm
for _ in range(int(input())):
	n = int(input())
	sm = sumdg(n)
	print(n * 10 + (10 - sm) % 10)


t = int(input())
for _ in range(t):
	N = int(input())
	for i in range(N * 10, N * 10 + 11):
		s = 0
		for digit in str(i):
			s += int(digit)
		if s % 10 == 0:
			print(i)
			break


T = int(input())
for ti in range(T):
	N = int(input())
	sumd = 0
	for i in str(N):
		sumd += int(i)
	ans = N * 10 + (10 - sumd) % 10
	print(ans)


T = int(input().strip())
for i in range(T):
	N = input().strip()
	s = 0
	for j in N:
		s += int(j)
	modd = s % 10
	digit = 10 - modd
	if digit == 10:
		print(int(N) * 10)
	else:
		print(int(N) * 10 + digit)


def sum(n):
	s = 0
	for d in str(n):
		s += int(d)
	return s
for i in range(int(input())):
	N = int(input())
	S = sum(N) % 10
	result = int(N * 10 + (10 - S) % 10)
	print(result)


T = int(input())

def decimal(N):
	sum_digits = 0
	while N > 0:
		sum_digits += N % 10
		N = N // 10
	return sum_digits
for tj in range(T):
	N = int(input())
	sum_digits = decimal(N)
	append = (10 - sum_digits % 10) % 10
	print(str(N) + str(append))


try:
	t = int(input())
	for i in range(t):
		m = 0
		n = int(input())
		l = list(str(n))
		li = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
		for k in range(len(l)):
			m += int(l[k])
		for j in range(len(li)):
			if (li[j] + m) % 10 == 0:
				l.append(str(li[j]))
				s = int(''.join(l))
				print(s)
except:
	pass


t = int(input())
while t != 0:
	list = []
	n = int(input())
	if n > 0 or n < pow(10, 18):
		sum = 0
		for d in str(n):
			sum += int(d)
		result = n * 10 + (10 - sum) % 10
		list.append(result)
		print(result)
	t = t - 1


T = int(input())
for t in range(T):
	N = int(input())
	inp = N
	add = 0
	while N != 0:
		add += N % 10
		N = N // 10
	k = 10 - add % 10
	if k == 10:
		ans = inp * 10
	else:
		ans = inp * 10 + k
	print(ans)


def sumOfDigit(N):
	c = 0
	while N != 0:
		c += N % 10
		N //= 10
	return c
for _ in range(int(input())):
	N = int(input())
	s = sumOfDigit(N) % 10
	print(N * 10 + (10 - s) % 10)


def sumOfDigits(n):
	c = 0
	while n != 0:
		c += n % 10
		n //= 10
	return c
for _ in range(int(input())):
	n = int(input())
	mod = sumOfDigits(n) % 10
	print(n * 10 + (10 - mod) % 10)


for i in range(int(input())):
	n = int(input())
	n1 = n
	s = 0
	while n1 != 0:
		digit = n1 % 10
		s += digit
		n1 //= 10
	mod = s % 10
	print(n * 10 + (10 - mod) % 10)


import math as p
t = int(input())
for _ in range(t):
	n = int(input())
	copy = n
	sumOfDigit = 0
	while copy != 0:
		digit = copy % 10
		sumOfDigit += digit
		copy //= 10
	mod = sumOfDigit % 10
	print(n * 10 + (10 - mod) % 10)


for i in range(int(input())):
	x = int(input())
	y = x * 10
	a = len(str(y))
	c = y
	d = 0
	for i in range(a):
		b = c % 10
		d += b
		c = c // 10
	e = (10 - d % 10) % 10
	f = y + e
	print(f)


for i in range(int(input())):
	c = int(input())
	print(c * 10 + (10 - sum(list(map(int, str(c)))) % 10) % 10)


for i in range(int(input())):
	n = int(input())
	a = n * 10
	for i in range(10):
		l = a + i
		s = str(l)
		t = 0
		for j in s:
			t += int(j)
		if t % 10 == 0:
			print(l)
			break


n = int(input())
for i in range(n):
	s = input()
	c = 0
	for j in s:
		c += int(j)
	if c % 10 > 0:
		c = 10 - c % 10
	else:
		c = 0
	print(int(s) * 10 + c)


for _ in range(int(input())):
	n = input()
	xd = 0
	for i in n:
		xd += int(i)
	if xd % 10 > 0:
		xd = 10 - xd % 10
	else:
		xd = 0
	print(int(n) * 10 + xd)


for _ in range(int(input())):
	v = int(input())
	pp = 10 * v
	for oo in range(10):
		ll = pp + oo
		bb = str(ll)
		cc = 0
		for vv in bb:
			cc += int(vv)
		if cc % 10 == 0:
			print(ll)
			break


for _ in range(int(input())):
	x = int(input())
	z = 10 * x
	for j in range(10):
		n = z + j
		l = str(n)
		sum = 0
		for k in l:
			sum = sum + int(k)
		if sum % 10 == 0:
			print(n)
			break


import math
t = int(input())
for i in range(0, t):
	x = int(input())
	z = 10 * x
	for j in range(10):
		n = z + j
		l = list(str(n))
		ans = 0
		for k in l:
			ans = ans + int(k)
		if ans % 10 == 0:
			print(n)
			break


import math
T = int(input())
for i in range(0, T):
	x = int(input())
	count = x * 10
	for j in range(10):
		n = count + j
		Sum = 0
		for a in list(str(n)):
			Sum = Sum + int(a)
		if Sum % 10 == 0:
			print(n)