On the board, Bob wrote $n$ positive integers in base $10$ with sum $s$ (i. e. in decimal numeral system). Alice sees the board, but accidentally interprets the numbers on the board as base-$11$ integers and adds them up (in base $11$).

What numbers should Bob write on the board, so Alice's sum is as large as possible?


-----Input-----

The input consists of multiple test cases. The first line contains an integer $t$ ($1 \leq t \leq 100$) — the number of test cases. The description of the test cases follows.

The only line of each test case contains two integers $s$ and $n$ ($1 \leq s \leq 10^9$; $1 \leq n \leq \min(100, s)$) — the sum and amount of numbers on the board, respectively. Numbers $s$ and $n$ are given in decimal notation (base $10$).


-----Output-----

For each test case, output $n$ positive integers — the numbers Bob should write on the board, so Alice's sum is as large as possible. If there are multiple answers, print any of them.


-----Examples-----

Input
6
97 2
17 1
111 4
100 2
10 9
999999 3
Output
70 27 
17 
3 4 100 4
10 90
1 1 2 1 1 1 1 1 1 
999900 90 9


-----Note-----

In the first test case, $70_{10} + 27_{10} = 97_{10}$, and Alice's sum is $$70_{11} + 27_{11} = 97_{11} = 9 \cdot 11 + 7 = 106_{10}.$$ (Here $x_b$ represents the number $x$ in base $b$.) It can be shown that it is impossible for Alice to get a larger sum than $106_{10}$.

In the second test case, Bob can only write a single number on the board, so he must write $17$.

In the third test case, $3_{10} + 4_{10} + 100_{10} + 4_{10} = 111_{10}$, and Alice's sum is $$3_{11} + 4_{11} + 100_{11} + 4_{11} = 110_{11} = 1 \cdot 11^2 + 1 \cdot 11 = 132_{10}.$$ It can be shown that it is impossible for Alice to get a larger sum than $132_{10}$.

Source: codeforces | Difficulty: HARD
Tags: Mathematics

Greedy algorithms

Implementation

Constructive algorithms


Solutions:
def read_int():
	return int(input())

def read_ints():
	return map(int, input().split(' '))

def solve(s, n):
	if n == 1:
		return [s]
	else:
		ss = str(s)
		l = len(ss)
		cc = 10 ** (l - 1)
		while s - cc < n - 1:
			cc //= 10
		return solve(s - cc, n - 1) + [cc]
t = read_int()
for case_num in range(t):
	(s, n) = read_ints()
	ans = solve(s, n)
	print(' '.join(map(str, ans)))


from __future__ import division, print_function
import math
import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def inp():
	return int(input())

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

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input().strip()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
for _ in range(inp()):
	(n, k) = invr()
	ans = []
	strt = 10 ** len(str(n))
	while len(ans) < k - 1:
		if k - len(ans) - 1 <= n - strt:
			ans.append(strt)
			n -= strt
		else:
			strt //= 10
	ans.append(n)
	print(*ans)


import os
import sys
from io import BytesIO, IOBase
_print = print
BUFSIZE = 8192

def dbg(*args, **kwargs):
	_print('\x1b[95m', end='')
	_print(*args, **kwargs)
	_print('\x1b[0m', end='')

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def inp():
	return sys.stdin.readline().rstrip()

def mpint():
	return map(int, inp().split(' '))

def itg():
	return int(inp())

def solve():
	(s, n) = mpint()
	ans = [1] * n
	tmp = s
	s -= n
	for i in range(n):
		new = ans[i] * 10
		cost = new - ans[i]
		while cost <= s:
			s -= cost
			ans[i] = new
			new = ans[i] * 10
			cost = new - ans[i]
	ans[0] += s
	assert sum(ans) == tmp and all([a > 0 for a in ans])
	return ans

def main():
	for _ in range(itg()):
		print(*solve())
DEBUG = 0
URL = 'https://codeforces.com/contest/1567/problem/D'
if DEBUG == 1:
	import requests
	from ACgenerator.Y_Test_Case_Runner import TestCaseRunner
	runner = TestCaseRunner(main, URL)
	inp = runner.input_stream
	print = runner.output_stream
	runner.checking()
else:
	if DEBUG != 2:
		dbg = lambda *args, **kwargs: ...
		(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	if DEBUG == 3:

		def print(*args, **kwargs):
			_print(*args, **kwargs)
			sys.stdout.flush()
	main()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(s, n) = input().split()
	n = int(n)
	left = int(s)
	s = list(map(int, s))
	nums = [0] * n
	curr = 0
	for i in range(len(s)):
		exp = len(s) - 1 - i
		d = s[i]
		for use in range(d, -1, -1):
			if left - use * 10 ** exp >= n - 1 - (curr + use - 1):
				left -= use * 10 ** exp
				for j in range(use):
					nums[curr] += 10 ** exp
					if curr != n - 1:
						curr += 1
				if i != len(s) - 1:
					s[i + 1] += 10 * (d - use)
				break
	print(*nums)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def val(isa):
	m = 1
	v = 0
	for i in range(len(isa)):
		v += isa[-(i + 1)] * m
		m *= 10
	return v
from collections import Counter

def intact(s, i, n, isa):
	if i == len(s) - 1:
		if isa[i] >= n:
			return True
		else:
			return RuntimeError
	if int(s[i + 1:]) >= n - isa[i]:
		return True
	return val(isa[i + 1:]) >= n - isa[i]
for _ in range(int(input())):
	(s, n) = input().split()
	bs = s
	n = int(n)
	bn = n
	ans = []
	ts = int(s)
	isa = [int(i) for i in s]
	for i in range(len(s)):
		if isa[i] == 0:
			continue
		while not intact(s, i, n, isa):
			if isa[i] == 0:
				break
			isa[i] -= 1
			isa[i + 1] += 10
		if isa[i] == 0:
			continue
		if isa[i] < n:
			ex = [10 ** (len(s) - 1 - i) for j in range(isa[i])]
			ans.extend(ex)
			n -= len(ex)
			ts -= len(ex) * 10 ** (len(s) - 1 - i)
		else:
			for j in range(n - 1):
				ts -= 10 ** (len(s) - 1 - i)
				ans.append(10 ** (len(s) - 1 - i))
			ans.append(ts)
			break
	print(*ans)
	assert sum(ans) == int(bs)
	assert len(ans) == bn


from collections import defaultdict, Counter, deque
from math import sqrt, log10, log, floor, factorial, gcd
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations
import sys, io, os
input = sys.stdin.readline
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
inf = float('inf')
mod = 10 ** 9 + 7

def yn(a):
	print('YES' if a else 'NO')
ceil = lambda a, b: (a + b - 1) // b
l = [10 ** i for i in range(10)]
t = int(input())
for i in range(t):
	(n, k) = [int(i) - 1 for i in input().split()]
	out = []
	while k:
		indexa = bisect_right(l, n) - 1
		if n - l[indexa] > k:
			out.append(l[indexa])
			n -= l[indexa]
		else:
			out.append(1)
			n -= 1
		k -= 1
	out.append(n + 1)
	print(*out)


T = int(input())
for _ in range(T):
	(s, n) = map(int, input().split())
	A = []
	N = s
	if n == 1:
		print(s)
	else:
		for i in range(n, 0, -1):
			if i > 1:
				temp = min(10 ** (len(str(N)) - 1), N - i + 1)
				temp = 10 ** (len(str(temp)) - 1)
				A.append(temp)
				N = N - temp
			else:
				A.append(N)
		A = map(str, A)
		print(' '.join(A))


import sys
import getpass
import math, random
import functools, itertools, collections, heapq, bisect
from collections import Counter, defaultdict, deque
input = sys.stdin.readline
M9 = 10 ** 9 + 7
(yes, no) = ('YES', 'NO')
MAXINT = sys.maxsize
OFFLINE_TEST = getpass.getuser() == 'hkmac'

def log(*args):
	if OFFLINE_TEST:
		print('\x1b[36m', *args, '\x1b[0m', file=sys.stderr)

def solve(*args):
	if OFFLINE_TEST:
		log('----- solving ------')
		log(*args)
		log('----- ------- ------')
	return solve_(*args)

def read_matrix(rows):
	return [list(map(int, input().split())) for _ in range(rows)]

def read_strings(rows):
	return [input().strip() for _ in range(rows)]

def minus_one(arr):
	return [x - 1 for x in arr]

def minus_one_matrix(mrr):
	return [[x - 1 for x in row] for row in mrr]

def solve_(n, s):
	res = [1 for _ in range(s)]
	n -= s
	for i in range(10, 0, -1):
		if n == 0:
			break
		demonination = 10 ** i
		res.sort(key=lambda x: x % demonination)
		res.reverse()
		for (i, x) in enumerate(res):
			next_target = demonination - x % demonination
			if n >= next_target:
				res[i] += next_target
				n -= next_target
		while n >= demonination:
			for (i, x) in enumerate(res):
				next_target = demonination - x % demonination
				if n >= next_target:
					res[i] += next_target
					n -= next_target
	res[0] += n
	cnt = 0
	for x in res:
		cnt += int(str(x), 11)
	log(cnt)
	return res
for case_num in range(int(input())):
	(n, s) = list(map(int, input().split()))
	res = solve(n, s)
	res = ' '.join((str(x) for x in res))
	print(res)


import sys
input = sys.stdin.readline
T = int(input())

def ch(n):
	res = []
	while n > 0:
		res.append(n % 10)
		n //= 10
	res2 = []
	while len(res) + len(res2) < 12:
		res2.append(0)
	return res + res2
for iii in range(T):
	(s, n) = map(int, input().split())
	ans = [1] * n
	nokori = s - n
	if n == 1:
		print(s)
		continue
	ind = 0
	while 10 ** (ind + 1) <= nokori:
		ind += 1
	while nokori > 0:
		if ind == 0:
			break
		for i in range(n):
			if ans[i] > 1:
				continue
			if nokori >= 10 ** ind - 1:
				ans[i] += 10 ** ind - 1
				nokori -= 10 ** ind - 1
		ans[0] += nokori - nokori % 10 ** ind
		nokori -= nokori - nokori % 10 ** ind
		ind -= 1
	ans[0] += nokori
	print(*ans)


def solve(s0, n):
	s = s0
	l = [0] * n
	for i in range(n):
		p = 1
		while 10 * p + (n - i - 1) <= s:
			p *= 10
		l[i] = p
		s -= p
	l[0] += s
	return l

def main():
	t = int(input())
	for _ in range(t):
		(s, n) = map(int, input().split())
		print(*solve(s, n))
main()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(s, n) = map(int, input().split())
	ans = []
	for i in range(n - 1):
		ss = int(s)
		ls = []
		while ss > 0:
			ls.append(ss % 10)
			ss //= 10
		sign = True
		p = len(ls) - 1
		while sign:
			if s - 10 ** p >= n - i - 1:
				ans.append(10 ** p)
				s -= 10 ** p
				sign = False
			else:
				p -= 1
	ans.append(s)
	print(*ans)


import sys
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def LI1():
	return list(map(int1, sys.stdin.readline().split()))

def LLI1(rows_number):
	return [LI1() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline().rstrip()
inf = 10 ** 16
md = 10 ** 9 + 7
from heapq import *

def solve():
	(s, n) = LI()
	one = []
	aa = []
	ten = 1
	while len(aa) + len(one) + 1 < n and s:
		while s % (ten * 10) == 0:
			ten *= 10
		if ten == 1:
			one.append(ten)
		else:
			heappush(aa, ten)
		s -= ten
	if s:
		heappush(aa, s)
	while len(one) + len(aa) < n:
		a = heappop(aa)
		cur = min(10, n - (len(one) + len(aa)))
		if a == 10:
			one += [1] * (cur - 1)
			one += [10 - (cur - 1)]
		else:
			for _ in range(cur - 1):
				heappush(aa, a // 10)
			heappush(aa, a // 10 * (10 - (cur - 1)))
	print(*one, *aa)
for testcase in range(II()):
	solve()


def reduce(seed):
	for (po, i) in enumerate(reversed(str(seed))):
		yield from ([10 ** po] * int(i))

def split(num):
	if num < 10:
		return [1] * num
	assert num % 10 == 0
	return [num // 10] * 10

def solve():
	(remaining_sum, remaining_nums) = [int(x) for x in input().split()]
	if remaining_nums == 1:
		return remaining_sum
	chosen_numbers = list(reduce(remaining_sum))
	while len(chosen_numbers) < remaining_nums:
		non_splittable = [i for i in chosen_numbers if i == 1]
		try:
			splittable = next((i for i in range(len(chosen_numbers)) if chosen_numbers[i] > 1))
		except StopIteration:
			chosen_numbers = non_splittable
			break
		non_splittable.extend(split(chosen_numbers[splittable]))
		non_splittable.extend(chosen_numbers[splittable + 1:])
		chosen_numbers = non_splittable
	if len(chosen_numbers) > remaining_nums:
		x = len(chosen_numbers) - remaining_nums + 1
		s = sum(chosen_numbers[:x])
		chosen_numbers = [s] + chosen_numbers[x:]
		assert len(chosen_numbers) == remaining_nums
	return ' '.join((str(num) for num in chosen_numbers))
for _ in range(int(input())):
	print(solve())


t = int(input())

def pow10(s):
	arr = []
	s = str(s)[-1::-1]
	for i in range(len(s)):
		for j in range(int(s[i])):
			arr.append(10 ** i)
	return arr
while t:
	t -= 1
	(s, n) = [int(x) for x in input().split()]
	arr = pow10(s)
	if n == len(arr):
		print(*arr)
	elif n < len(arr):
		while n != len(arr):
			a = arr.pop() + arr.pop()
			arr.append(a)
		print(*arr)
	else:
		arr = arr[-1::-1]
		temp = []
		sub = []
		for i in range(11):
			sub.append(10 ** i)
		sub = sub[-1::-1]
		while n != len(arr):
			arr.sort(reverse=True)
			last = arr.pop()
			if last == 1:
				temp.append(1)
				n -= 1
			while True:
				if n > len(arr):
					for item in sub:
						if item < last:
							while last:
								arr.append(item)
								last -= item
							break
				else:
					if last != 1:
						arr.append(last)
					while len(temp) > 1 and n != len(arr):
						a = temp.pop() + temp.pop()
						temp.append(a)
						n += 1
					while n != len(arr):
						a = arr.pop() + arr.pop()
						arr.append(a)
				break
		arr += temp
		print(*arr)


for _ in range(int(input())):
	(s, n) = map(int, input().split())
	ans = []
	x = 10 ** (len(str(s)) - 1)
	for i in range(n - 1):
		while s - x < n - (i + 1):
			x //= 10
		ans.append(x)
		s -= x
	ans.append(s)
	print(*ans)


for _ in range(int(input())):
	(s, n) = map(int, input().split())
	while s != 0:
		if n == 1:
			print(s)
			break
		cu = 1
		while cu * 10 <= s - n + 1:
			cu *= 10
		s -= cu
		print(cu, end=' ')
		n -= 1


def solve(s, n):
	if n == 1:
		return [s]
	if s < 10:
		return solve(s - 1, n - 1) + [1]
	top = (s - int(str(s)[1:])) // int(str(s)[0])
	if s - top >= n - 1:
		return solve(s - top, n - 1) + [top]
	elif s - top // 10 >= n - 1:
		return solve(s - top // 10, n - 1) + [top // 10]
	else:
		return solve(s - top // 100, n - 1) + [top // 100]
t = int(input())
for i in range(t):
	(s, n) = input().split()
	s = int(s)
	n = int(n)
	v = solve(s, n)
	res = ''
	for e in v:
		res += str(e) + ' '
	print(res)


def answer():
	(s, n) = map(int, input().split())
	ans = []
	tn = int(s)
	if n == 1:
		print(s)
		return
	s = list(str(s))
	cnt = 0
	k = len(s) - 1
	flg = 0
	from bisect import bisect_right
	for i in range(k + 1):
		for j in range(int(s[-1 - i])):
			if cnt != n - 1:
				ans.append(10 ** i)
				tn -= 10 ** i
				cnt += 1
			else:
				flg = 1
				ans.append(tn)
				break
		if flg == 1:
			break
	if len(ans) == n:
		print(' '.join([str(i) for i in ans]))
		return
	while cnt < n:
		ans.sort()
		if n - cnt > 9:
			t_num = bisect_right(ans, 1)
			tmp = ans[t_num]
			ans.remove(tmp)
			ans.extend([tmp // 10] * 10)
			cnt += 9
		else:
			delta = 10 - (n - cnt)
			t_num = bisect_right(ans, 1)
			tmp = ans[t_num]
			ans.remove(tmp)
			ans.extend([tmp // 10] * (n - cnt))
			ans.extend([delta * (tmp // 10)])
			cnt += 10
	print(' '.join([str(i) for i in ans]))
	return
t = int(input())
for _ in range(t):
	answer()


import sys
input = sys.stdin.readline
t = int(input())
for tests in range(t):
	(s, n) = map(int, input().split())
	nonzero = 0
	A = [0] * n
	x = 10 ** 9
	while s:
		for i in range(9 * n, -1, -1):
			if s - x * i >= max(0, n - i - nonzero):
				y = i
				break
		if y == 0:
			x //= 10
			continue
		if 0 in A:
			t = A.index(0)
			for u in range(y):
				A[(t + u) % n] += x
				s -= x
				if nonzero < n:
					nonzero += 1
			x //= 10
		else:
			for u in range(y):
				A[u % n] += x
				s -= x
			x //= 10
	print(*A)


q = int(input())
for _ in range(q):
	(s, n) = map(int, input().split())
	A = []
	B = []
	cur = 1
	while s:
		for i in range(s % 10):
			A.append(cur)
		cur *= 10
		s //= 10
	A.reverse()
	while len(A) + len(B) < n:
		x = A[-1]
		A.pop()
		if x == 1:
			B.append(x)
		else:
			for i in range(10):
				A.append(x // 10)
	for i in B:
		A.append(i)
	while len(A) > n:
		x = A[-1]
		y = A[-2]
		A.pop()
		A.pop()
		A.append(x + y)
	for i in A:
		print(i, end=' ')
	print()


from sys import stdin, stdout, maxsize
from math import sqrt, log, factorial as ft, gcd, ceil, floor
from collections import defaultdict
ii = lambda : int(input())
di = lambda : defaultdict(lambda : 0)
dl = lambda : defaultdict(lambda : list())
li = lambda : list(map(int, stdin.readline().strip().split()))
mi = lambda : map(int, stdin.readline().strip().split())
si = lambda : stdin.readline().strip()
for _ in range(ii()):
	(s, n) = mi()
	f = 1
	l = []
	s1 = str(s)[::-1]
	for i in s1:
		x = int(i) * f
		if x:
			l.append(int(i) * f)
		f *= 10
	ln = len(l)
	if ln == n:
		print(*l)
	elif ln > n:
		ans = []
		for j in range(n - 1):
			ans.append(l[j])
		ans.append(sum(l[n - 1:]))
		print(*ans)
	else:
		s = [int(i) for i in s1]
		total = sum(s)
		while total < n:
			ix = 1
			for j in range(1, len(s)):
				if s[j]:
					ix = j
					break
			s[ix] -= 1
			s[ix - 1] += 10
			total += 9
		f = 1
		i = 0
		final = 0
		ans = []
		while final < n - 1:
			for j in range(s[i]):
				if final == n - 1:
					break
				s[i] -= 1
				ans.append(f)
				final += 1
			i += 1
			f *= 10
		f = 1
		for i in range(len(s)):
			s[i] *= f
			f *= 10
		ans.append(sum(s))
		print(*ans)


def process(s, n):
	if n == 0:
		return []
	if n == 1:
		return [s]
	if s == n:
		return [1 for i in range(n)]
	if s < 10:
		return [s - n + 1] + [1 for i in range(n - 1)]
	s2 = list(str(s))
	for i in range(len(s2) - 1, -1, -1):
		if s - 10 ** i >= n - 1:
			a1 = process(s - 10 ** i, n - 1)
			return a1 + [10 ** i]
t = int(input())
for i in range(t):
	(s, n) = [int(x) for x in input().split()]
	answer = process(s, n)
	print(' '.join(map(str, answer)))


for _ in range(int(input())):
	(s, n) = map(int, input().split())
	res = [0 for _ in range(n)]
	i = 0
	cur = 1
	while s:
		k = s // cur % 10
		if k == 0:
			cur *= 10
			continue
		res[i] += cur
		s -= cur
		i = (i + 1) % n
	bad = n - i
	while 0 in res:
		ids = res.index(max(res))
		for i in range(n):
			if res[i] > 1 and res[i] < res[ids]:
				ids = i
		s += res[ids] // 10 * 9
		res[ids] -= res[ids] // 10 * 9
		cur = 1
		while s:
			k = s // cur % 10
			if k == 0:
				cur *= 10
				continue
			if res[i] != 0 and bad != 0:
				i = (i + 1) % n
				continue
			if bad == 0:
				break
			res[i] += cur
			bad -= 1
			s -= cur
			i = (i + 1) % n
	res[0] += s
	print(*res)


import sys
import os
import time
from functools import reduce
from math import *
LOCAL = not __debug__

def main():
	(a, b) = map(int, input().split())
	l = []
	(x, cnt) = (a - b, b - 1)
	for i in range(9, 0, -1):
		n = 10 ** i
		d = min(cnt, x // (n - 1))
		cnt -= d
		l += d * [n]
		x -= d * (n - 1)
	l += cnt * [1]
	l.append(x + 1)
	assert sum(l) == a, f'{sum(l)} != {a}'
	assert len(l) == b, f'{len(l)} != {b}'
	for it in l:
		print(it, end=' ')
	print()
T1 = time.time()
if LOCAL:
	sys.stdin = open('hack.txt', 'r')
	sys.stdout = open('hack.out', 'w')
t = int(input())
for i in range(t):
	main()
T2 = time.time()
print('Runtime: %.3f s.' % (T2 - T1), file=sys.stderr)


import os, sys
from io import BytesIO, IOBase
from math import log2, ceil, sqrt, gcd
from _collections import deque
import heapq as hp
from bisect import bisect_left, bisect_right
from math import cos, sin
from itertools import permutations
from operator import itemgetter
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
mod = 10 ** 9 + 7
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	x -= y
	ans = []
	while y:
		x += 1
		if y == 1:
			ans.append(x)
			break
		z = str(x)
		l = len(z) - 1
		ans.append(10 ** l)
		x -= 10 ** l
		y -= 1
	print(*ans)


from collections import defaultdict as dd
import math
import sys
input = sys.stdin.readline

def nn():
	return int(input())

def li():
	return list(input())

def mi():
	return map(int, input().split())

def lm():
	return list(map(int, input().split()))

def solve():
	(s, n) = mi()
	g = str(s)
	digs = [int(d) for d in list(g)]
	dsum = sum(digs)
	c_required = n - dsum
	digs = digs[::-1]
	d_place = 1
	while c_required > 0:
		if digs[d_place] >= 1:
			digs[d_place] -= 1
			digs[d_place - 1] += 10
			c_required -= 9
			if d_place > 1:
				d_place -= 1
		else:
			d_place += 1
	place = 0
	ans = []
	cur_total = 0
	while len(ans) < n - 1:
		if digs[place] > 0:
			ans.append(10 ** place)
			digs[place] -= 1
			cur_total += 10 ** place
		else:
			place += 1
	ans.append(s - cur_total)
	print(*ans)
q = nn()
for _ in range(q):
	solve()


t = int(input())
for i in range(t):
	(s, n) = list(map(int, input().split()))
	res = []
	if n == 1:
		print(s)
		continue
	i = 10 ** len(str(s))
	while len(res) < n - 1:
		while len(res) < n - 1 and n - len(res) - 1 <= s - i:
			res.append(i)
			s -= i
		i //= 10
	res.append(s)
	print(*res)


import sys
from bisect import bisect_right as lb
from collections import deque
from queue import PriorityQueue as pq
from math import gcd
input_ = lambda : sys.stdin.readline().strip('\r\n')
ii = lambda : int(input_())
il = lambda : list(map(int, input_().split()))
ilf = lambda : list(map(float, input_().split()))
lii = lambda : list(map(int, list(ip())))
ip = lambda : input_()
fi = lambda : float(input_())
ap = lambda ab, bc, cd: ab[bc].append(cd)
li = lambda : list(input_())
pr = lambda x: print(x)
prinT = lambda x: print(x)
f = lambda : sys.stdout.flush()
inv = lambda x: pow(x, mod - 2, mod)
mod = 10 ** 9 + 7
for _ in range(ii()):
	(s, n) = il()
	a = [s]
	while len(a) < n:
		x = -1
		for j in range(len(a)):
			if str(a[j]) != '1' + '0' * len(str(a[j])[1:]):
				x = a[j]
				a.pop(j)
				break
		if x == -1:
			mx = float('inf')
			for j in range(len(a)):
				if a[j] != 1:
					mx = min(mx, a[j])
			for j in range(len(a)):
				if mx == a[j]:
					x = a[j]
					a.pop(j)
					break
		t = 1
		while t < x:
			t *= 10
		a.append(t // 10)
		a.append(x - t // 10)
	print(*a)


import sys, math
from collections import deque
input = sys.stdin.readline
INF = int(1000000000.0) + 7
dx = [-1, 0, 1, 0]
dy = [0, 1, 0, -1]

def solve():
	(s, n) = map(int, input().split())
	base = s
	summ = 0
	data = [int(i) for i in str(s)[::-1]]
	result = []
	l = len(data)
	for i in data:
		summ += int(i)
	if n <= summ:
		while n != 1:
			n -= 1
			for i in range(l):
				if data[i] > 0:
					data[i] -= 1
					result.append(10 ** i)
					base -= 10 ** i
					break
		result.append(base)
		print(*result, sep=' ')
		return
	else:
		make = deque()
		while base:
			n -= 1
			for i in range(l):
				if data[i] > 0:
					data[i] -= 1
					if i == 0:
						result.append(10 ** i)
					else:
						make.append(10 ** i)
					base -= 10 ** i
					break
		while True:
			if n >= 9:
				k = make.popleft()
				if k // 10 == 1:
					result += [1] * 10
				else:
					for _ in range(10):
						make.appendleft(k // 10)
				n -= 9
			else:
				k = make.popleft()
				result += [k // 10] * n
				result.append(k // 10 * (10 - n))
				n = 0
			if n == 0:
				break
		result += list(make)
		print(*result, sep=' ')
t = int(input())
while t:
	t -= 1
	solve()


for __ in range(int(input())):
	(n, m) = map(int, input().split())
	s = []
	i = 0
	while n // 10 != 0:
		k = n % 10
		n = n // 10
		for j in range(k):
			s.append(10 ** i)
		i += 1
	for j in range(n):
		s.append(10 ** i)
	while len(s) < m:
		for i in s:
			if i != 1:
				break
		for j in range(10):
			s.append(i // 10)
		s.remove(i)
		s.sort()
	ans = ''
	final = 0
	for i in range(m - 1):
		ans += str(s[i]) + ' '
	for i in range(m - 1, len(s)):
		final += s[i]
	ans += str(final)
	print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
import math
import collections
from itertools import permutations
from itertools import combinations
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def prob():
	(s, n) = [int(x) for x in input().split()]
	l = len(str(s))
	ans = []
	x = 10 ** (l - 1)
	for i in range(n - 1):
		while s - x < n - i - 1:
			x = x // 10
		ans.append(x)
		s -= x
	ans.append(s)
	print(*ans)
t = 1
t = int(input())
for _ in range(0, t):
	prob()


import sys
from sys import stdin
tt = int(stdin.readline())

def check(lis):
	ret = 0
	for i in range(len(lis)):
		ret += 11 ** i * lis[i]
	return ret
for loop in range(tt):
	(s, n) = map(int, stdin.readline().split())
	ts = s
	lis = []
	while ts > 0:
		lis.append(ts % 10)
		ts //= 10
	while sum(lis) < n:
		for i in range(1, len(lis)):
			if lis[i] > 0:
				lis[i] -= 1
				lis[i - 1] += 10
				break
	ans = [0] * n
	nind = 0
	for i in range(n):
		while lis[nind] <= 0:
			nind += 1
		ans[i] += 10 ** nind
		lis[nind] -= 1
	for j in range(len(lis)):
		for i in range(lis[j]):
			ans[0] += 10 ** j
	print(*ans)


import sys
from collections import Counter, deque
input = sys.stdin.buffer.readline
T = int(input())
for _ in range(T):
	(s, n) = map(int, input().split())
	(m, nums) = (1, [])
	while s:
		nums.extend([m] * (s % 10))
		(s, m) = (s // 10, m * 10)
	(cc, next) = (len(nums), [])
	for u in nums:
		if cc >= n or u == 1:
			next.append(u)
		else:
			q = deque([u // 10] * 10)
			cc += 9
			while q and cc < n:
				v = q.popleft()
				if v == 1:
					next.append(1)
				else:
					q.extendleft([v // 10] * 10)
					cc += 9
			if q:
				next.extend(q)
	nums = next
	while cc > n:
		(n1, n2) = (nums.pop(), nums.pop())
		nums.append(n1 + n2)
		cc -= 1
	print(*nums)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

class SortedList:

	def __init__(self, iterable=[], _load=200):
		values = sorted(iterable)
		self._len = _len = len(values)
		self._load = _load
		self._lists = _lists = [values[i:i + _load] for i in range(0, _len, _load)]
		self._list_lens = [len(_list) for _list in _lists]
		self._mins = [_list[0] for _list in _lists]
		self._fen_tree = []
		self._rebuild = True

	def _fen_build(self):
		self._fen_tree[:] = self._list_lens
		_fen_tree = self._fen_tree
		for i in range(len(_fen_tree)):
			if i | i + 1 < len(_fen_tree):
				_fen_tree[i | i + 1] += _fen_tree[i]
		self._rebuild = False

	def _fen_update(self, index, value):
		if not self._rebuild:
			_fen_tree = self._fen_tree
			while index < len(_fen_tree):
				_fen_tree[index] += value
				index |= index + 1

	def _fen_query(self, end):
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		x = 0
		while end:
			x += _fen_tree[end - 1]
			end &= end - 1
		return x

	def _fen_findkth(self, k):
		_list_lens = self._list_lens
		if k < _list_lens[0]:
			return (0, k)
		if k >= self._len - _list_lens[-1]:
			return (len(_list_lens) - 1, k + _list_lens[-1] - self._len)
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		idx = -1
		for d in reversed(range(len(_fen_tree).bit_length())):
			right_idx = idx + (1 << d)
			if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:
				idx = right_idx
				k -= _fen_tree[idx]
		return (idx + 1, k)

	def _delete(self, pos, idx):
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len -= 1
		self._fen_update(pos, -1)
		del _lists[pos][idx]
		_list_lens[pos] -= 1
		if _list_lens[pos]:
			_mins[pos] = _lists[pos][0]
		else:
			del _lists[pos]
			del _list_lens[pos]
			del _mins[pos]
			self._rebuild = True

	def _loc_left(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(lo, pos) = (-1, len(_lists) - 1)
		while lo + 1 < pos:
			mi = lo + pos >> 1
			if value <= _mins[mi]:
				pos = mi
			else:
				lo = mi
		if pos and value <= _lists[pos - 1][-1]:
			pos -= 1
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value <= _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def _loc_right(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(pos, hi) = (0, len(_lists))
		while pos + 1 < hi:
			mi = pos + hi >> 1
			if value < _mins[mi]:
				hi = mi
			else:
				pos = mi
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value < _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def add(self, value):
		_load = self._load
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len += 1
		if _lists:
			(pos, idx) = self._loc_right(value)
			self._fen_update(pos, 1)
			_list = _lists[pos]
			_list.insert(idx, value)
			_list_lens[pos] += 1
			_mins[pos] = _list[0]
			if _load + _load < len(_list):
				_lists.insert(pos + 1, _list[_load:])
				_list_lens.insert(pos + 1, len(_list) - _load)
				_mins.insert(pos + 1, _list[_load])
				_list_lens[pos] = _load
				del _list[_load:]
				self._rebuild = True
		else:
			_lists.append([value])
			_mins.append(value)
			_list_lens.append(1)
			self._rebuild = True

	def discard(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_right(value)
			if idx and _lists[pos][idx - 1] == value:
				self._delete(pos, idx - 1)

	def remove(self, value):
		_len = self._len
		self.discard(value)
		if _len == self._len:
			raise ValueError('{0!r} not in list'.format(value))

	def pop(self, index=-1):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		value = self._lists[pos][idx]
		self._delete(pos, idx)
		return value

	def bisect_left(self, value):
		(pos, idx) = self._loc_left(value)
		return self._fen_query(pos) + idx

	def bisect_right(self, value):
		(pos, idx) = self._loc_right(value)
		return self._fen_query(pos) + idx

	def count(self, value):
		return self.bisect_right(value) - self.bisect_left(value)

	def __len__(self):
		return self._len

	def __getitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		return self._lists[pos][idx]

	def __delitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		self._delete(pos, idx)

	def __contains__(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_left(value)
			return idx < len(_lists[pos]) and _lists[pos][idx] == value
		return False

	def __iter__(self):
		return (value for _list in self._lists for value in _list)

	def __reversed__(self):
		return (value for _list in reversed(self._lists) for value in reversed(_list))

	def __repr__(self):
		return 'SortedList({0})'.format(list(self))

def main():
	t = int(input())
	for _ in range(t):
		(s, n) = input().split()
		n = int(n)
		sol = SortedList([0] * n)
		p10 = 1
		for i in reversed(s):
			for j in range(int(i)):
				org = sol[0]
				sol.remove(org)
				sol.add(org + p10)
			p10 *= 10
		while sol[0] == 0:
			org = sol[sol.bisect_right(1)]
			new = org // 10
			sol.remove(org)
			sol.add(new)
			for _ in range(9):
				org = sol[0]
				sol.remove(org)
				sol.add(org + new)
		print(*sol)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from sys import stdin, gettrace
if gettrace():

	def inputi():
		return input()
else:

	def input():
		return next(stdin)[:-1]

	def inputi():
		return stdin.buffer.readline()

def solve():
	(s, n) = input().split()
	dd = [int(d) for d in s]
	n = int(n)
	s = int(s)
	res = [0] * n
	while sum(dd) < n:
		for i in range(len(dd) - 2, -1, -1):
			if dd[i] != 0:
				dd[i + 1] += 10
				dd[i] -= 1
				break
	p = 0
	i = 1
	for d in dd[::-1]:
		res[p:min(n - 1, p + d)] = [i] * min(n - 1 - p, d)
		p += min(n - 1 - p, d)
		i *= 10
	res[n - 1] = s - sum(res)
	print(' '.join(map(str, res)))

def main():
	t = int(input())
	for _ in range(t):
		solve()
main()


import sys
import math
import heapq
import bisect
from collections import Counter
from collections import defaultdict
from io import BytesIO, IOBase
from itertools import permutations
import string

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None
		self.BUFSIZE = 8192

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, self.BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, self.BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def get_int():
	return int(input())

def get_ints():
	return list(map(int, input().split(' ')))

def get_int_grid(n):
	return [get_ints() for _ in range(n)]

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

def get_strs():
	return get_str().split(' ')

def flat_list(arr):
	return [item for subarr in arr for item in subarr]

def yes_no(b):
	if b:
		return 'YES'
	else:
		return 'NO'

def binary_search(good, left, right, delta=1, right_true=False):
	limits = [left, right]
	while limits[1] - limits[0] > delta:
		if delta == 1:
			mid = sum(limits) // 2
		else:
			mid = sum(limits) / 2
		if good(mid):
			limits[int(right_true)] = mid
		else:
			limits[int(~right_true)] = mid
	if good(limits[int(right_true)]):
		return limits[int(right_true)]
	else:
		return False

def prefix_sums(a):
	p = [0]
	for x in a:
		p.append(p[-1] + x)
	return p

def solve_a():
	n = get_int()
	s = get_str()
	r = []
	if 'U' in s:
		for x in s:
			if x == 'U':
				r.append('D')
			else:
				r.append(x)
	else:
		for x in s:
			if x == 'D':
				r.append('U')
			else:
				r.append(x)
	return ''.join(r)
xors = [0]
for i in range(1, 3 * 10 ** 5):
	xors.append(xors[-1] ^ i)

def solve_b():
	(a, b) = get_ints()
	xor = xors[a - 1]
	if xor == b:
		return a
	elif b ^ xor == a:
		return a + 2
	else:
		return a + 1

def solve_c():
	s = list(map(int, get_str()))
	k = 1 << max(0, len(s) - 2)
	cnt = 0
	adds = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
	for i in range(k):
		r = s.copy()
		for j in range(len(s) - 2):
			if i & 1 << j:
				r[j] -= 1
				r[j + 2] += 10
		tmp = 1
		for x in r:
			tmp *= adds[x]
		cnt += tmp
	return cnt - 2

def solve_d():
	(s, n) = get_ints()
	ans = []
	while n > 1:
		n -= 1
		j = len(str(s))
		while j > -1:
			if s - 10 ** j >= n:
				ans.append(10 ** j)
				s -= 10 ** j
				break
			j -= 1
	ans.append(s)
	return ans
t = get_int()
for _ in range(t):
	print(*solve_d())


def naiveSolve():
	return

def solve(s, n):
	m = 1
	arr = []
	while s > 0:
		x = s % 10
		for _ in range(x):
			arr.append(m)
		s //= 10
		m *= 10
	while len(arr) < n:
		smallestNonOne = 2000000000.0
		for x in arr:
			if x < smallestNonOne and x > 1:
				smallestNonOne = x
		arr.remove(smallestNonOne)
		for _ in range(10):
			x = smallestNonOne // 10
			arr.append(x)
	while len(arr) > n:
		back = arr.pop()
		arr[-1] += back
	return arr
	return

def main():
	t = int(input())
	allans = []
	for _ in range(t):
		allans.append(solve(*readIntArr()))
	multiLineArrayOfArraysPrint(allans)
	return
import sys
input = sys.stdin.buffer.readline

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))

def multiLineArrayOfArraysPrint(arr):
	print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

def readIntArr():
	return [int(x) for x in input().split()]

def makeArr(defaultValFactory, dimensionArr):
	dv = defaultValFactory
	da = dimensionArr
	if len(da) == 1:
		return [dv() for _ in range(da[0])]
	else:
		return [makeArr(dv, da[1:]) for _ in range(da[0])]

def queryInteractive(x):
	print('{}'.format(x))
	sys.stdout.flush()
	return int(input())

def answerInteractive(ans):
	print('! {}'.format(ans))
	sys.stdout.flush()
inf = float('inf')
from math import gcd, floor, ceil
for _abc in range(1):
	main()


import sys
r = sys.stdin.readline
for _ in range(int(r())):
	(N, K) = map(int, r().split())
	S = 0
	a = []
	N = list(map(int, list(str(N))))
	L = len(N)
	for i in range(L):
		S += N[i]
		for j in range(N[i]):
			a.append(pow(10, L - i - 1))
	if S >= K:
		temp = 0
		idx = 0
		for i in range(S - K):
			idx = i + 1
			temp += a[i]
		print(temp + a[idx], end=' ')
		for i in range(idx + 1, S):
			print(a[i], end=' ')
	else:
		while S < K:
			for i in range(L - 2, -1, -1):
				if N[i] != 0:
					N[i] -= 1
					N[i + 1] += 10
					S += 9
					break
		a = []
		for i in range(L):
			for j in range(N[i]):
				a.append(pow(10, L - i - 1))
		temp = 0
		idx = 0
		for i in range(S - K):
			idx = i + 1
			temp += a[i]
		print(temp + a[idx], end=' ')
		for i in range(idx + 1, S):
			print(a[i], end=' ')
	print()


t = int(input())
for _ in range(t):
	(s, n) = map(int, input().strip().split())
	L = [0 for _ in range(n)]
	ptr = 0
	for i in [10 ** k for k in range(9, -1, -1)]:
		while s >= i and s - i >= n - ptr - 1:
			L[ptr] += i
			s -= i
			ptr += 1
			if ptr >= n:
				ptr = n - 1
	for i in L:
		print(i, end=' ')
	print('')


import math

def create_split(s, n):
	if n == 1:
		return [s]
	order = math.floor(math.log10(s))
	chunk = 10 ** order
	while s - chunk < n - 1:
		order -= 1
		chunk //= 10
	return [chunk] + create_split(s - chunk, n - 1)

def solve():
	(s, n) = [int(x) for x in input().split(' ')]
	sol_set = create_split(s, n)
	return ' '.join((str(x) for x in sol_set))

def main():
	num_tests = int(input())
	for t in range(1, num_tests + 1):
		print(solve())
main()


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	(s, n) = map(int, input().split())
	res = [0] * (n + 1)
	now = 1
	while now <= n:
		v = s
		for x in range(now + 1, n + 1):
			v -= 1
		vv = 1
		while v:
			v //= 10
			vv *= 10
		vv //= 10
		noww = n + 1
		for x in range(now, n + 1):
			if n - now + vv > s:
				noww = x
				break
			res[x] += vv
			s -= vv
		now = noww
	res[n] += s
	for x in res[1:]:
		print(x, end=' ')
	print()


test = int(input())
for i in range(test):
	(sum, n) = [int(x) for x in input().split()]
	required_sum = sum - n
	outcome = []
	while n > 1:
		lenght = len(str(required_sum))
		value = 10 ** (lenght - 1)
		if lenght == len(str(required_sum + 1)):
			outcome.append(value)
			required_sum -= value - 1
			n -= 1
		else:
			outcome.append(10 * value)
			required_sum -= 10 * value - 1
			n -= 1
	if n == 1:
		outcome.append(1 + required_sum)
	print(*outcome)


for _ in range(int(input())):
	(s, n) = map(int, input().split())
	arr = []
	for i in range(1, n):
		m = s - (n - i)
		length = len(str(m))
		val = '1' + '0' * (length - 1)
		arr.append(val)
		s -= int(val)
	arr.append(str(s))
	print(' '.join(arr))


def solve(n, s):
	l = 1
	while l <= s:
		l *= 10
	l //= 10
	fill = 0
	bar = []
	while s:
		while l > s:
			l //= 10
		s -= l
		bar.append(l)
	r = []
	while bar:
		if len(r) == n - 1:
			r.append(sum(bar))
			bar = None
		elif len(r) + len(bar) >= n or bar[-1] == 1:
			r.append(bar.pop())
		else:
			a = bar.pop()
			bar += 10 * [a // 10]
	return r
t = int(input())
for _ in range(t):
	(s, n) = map(int, input().split())
	print(' '.join(map(str, solve(n, s))))


ans = []
for _ in range(int(input())):
	(s, n) = input().split()
	n = int(n)
	if n == 1:
		ans.append(s)
		continue
	lst = int(s)
	s = list(map(int, list(s)))
	cur = []
	sm = 0
	for i in range(len(s)):
		pw = 10 ** (len(s) - i - 1)
		lst -= s[i] * pw
		for x in range(s[i], -1, -1):
			if lst + x + (s[i] - x) * pw + sm >= n:
				X = x
				break
		cur += [pw] * X
		lst += (s[i] - X) * pw
		if s[i] > X:
			s[i + 1] += (s[i] - X) * 10
		sm += X
	while len(cur) > n:
		cur[-2] += cur[-1]
		cur.pop()
	ans.append(' '.join(map(str, cur)))
print('\n'.join(ans))


t = int(input())
cases = []
for i in range(t):
	cases.append(list(map(int, input().split())))

def answer(a, b):
	ans = []
	if b == 1:
		return [a]
	else:
		bas = len(str(a))
		temp = 0
		i = bas - 1
		while i >= 0:
			if b == 1:
				break
			if a - 10 ** i >= b - 1:
				ans.append(10 ** i)
				a -= 10 ** i
				b -= 1
			if a - 10 ** i < b - 1:
				i -= 1
			if b == 0:
				break
		if b == 1:
			ans.append(a)
	return ans
for i in cases:
	print(*answer(i[0], i[1]))


import sys
import heapq
import math
from bisect import bisect_left as bisect
input = sys.stdin.readline

def main():
	pow10 = [1]
	for _ in range(10):
		pow10.append(pow10[-1] * 10)

	def digs1(n):
		digs = []
		while n:
			digs.append(n % 10)
			n //= 10
		return digs
	t = int(input())
	for _ in range(t):
		(n, k) = map(int, input().split())
		digs = digs1(n)
		d = len(digs)
		heap = []
		ones = digs[0]
		for i in range(1, d):
			for p in range(digs[i]):
				heap.append(pow10[i])
		while len(heap) + ones < k:
			j = heapq.heappop(heap)
			ij = bisect(pow10, j)
			if ij == 1:
				ones += 10
			else:
				for _ in range(10):
					heapq.heappush(heap, pow10[ij - 1])
		l = len(heap)
		if l >= k:
			last = ones
			for _ in range(l - (k - 1)):
				last += heapq.heappop(heap)
			print(*heap, last)
		else:
			need = k - l
			print(*heap, *[1 for _ in range(need - 1)], ones - need + 1)
main()


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
from collections import defaultdict
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default=2 ** 51, func=lambda a, b: a & b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] < key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
for ik in range(int(input())):
	(s, n) = map(int, input().split())
	s = str(s)
	le = len(s)
	if n == 1:
		print(s)
		continue
	s = [int(s[i]) for i in range(le)]
	su = sum(s)
	while su < n:
		for i in range(le - 2, -1, -1):
			if s[i] == 0:
				continue
			for j in range(i, le - 1):
				s[j] -= 1
				s[j + 1] += 10
				su += 9
				if su >= n:
					break
			if su < n:
				while su < n:
					if s[-2] == 0:
						break
					s[-1] += 10
					s[-2] -= 1
					su += 9
			break
	ans = [0] * n
	po = pow(10, le - 1)
	t = 0
	for i in range(le):
		for j in range(s[i]):
			ans[t % n] += 1 * po
			t += 1
		po //= 10
	print(*ans)


for _ in range(int(input())):
	(x, n) = list(map(int, input().split()))
	digits = len(str(x))
	total = [0] * digits
	powten = 1
	power = 0
	while power < digits:
		total[power] = x // powten % 10
		n -= total[power]
		power += 1
		powten *= 10
	curr = 1
	while n > 0:
		if total[curr] == 0:
			curr += 1
			if curr >= digits:
				curr = 1
		else:
			total[curr] -= 1
			total[curr - 1] += 10
			n -= 9
			if curr > 1:
				curr -= 1
	curr = 0
	presum = 0
	powten = 1
	n -= 1
	while n < 0:
		if -n >= total[curr]:
			n += total[curr]
			presum += powten * total[curr]
			total[curr] = 0
		else:
			presum += -n * powten
			total[curr] += n
			n = 0
		curr += 1
		powten *= 10
	print(presum, end=' ')
	powten = 1
	for i in range(digits):
		for j in range(total[i]):
			print(powten, end=' ')
		powten *= 10
	print()


def f(x):
	S = str(x)
	ans = 0
	for i in range(len(S)):
		ans += int(S[i])
	return ans
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	Ans = []
	while True:
		if m > f(n):
			z = 0
			while n - 10 ** (z + 1) >= m - 1:
				z += 1
			Ans.append(10 ** z)
			n -= 10 ** z
			m -= 1
			if m == 0:
				break
		else:
			z = 0
			for i in range(m - 1):
				while n % 10 ** (z + 1) == 0:
					z += 1
				Ans.append(10 ** z)
				n -= 10 ** z
			Ans.append(n)
			break
	print(*Ans)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def main(t):
	(s, n) = map(int, input().split())
	rest = n
	ans = []
	diff = s - n
	begin = 9999999999
	rest = n
	while begin >= 0:
		if begin > 0 and diff // begin < rest:
			rest -= diff // begin
			ans += [str(begin + 1)] * (diff // begin)
			diff -= diff // begin * begin
			begin = begin // 10
		else:
			ans += [str(begin + 1)] * (rest - 1)
			diff -= begin * (rest - 1)
			ans += [str(diff + 1)]
			break
	ans = ' '.join(map(str, ans))
	print(ans)
T = int(input())
t = 1
while t <= T:
	main(t)
	t += 1


t = int(input())

def getTot(a):
	return sum(map(lambda x: base11(x), a))

def base11(x):
	return int(str(x), 11)
for _ in range(t):
	(s, n) = map(int, input().split())
	nums = [s]
	currTot = getTot(nums)
	for _ in range(n - 1):
		bestI = -1
		bestChange = -10 ** 10
		bestNum = 0
		for i in range(len(nums)):
			currNum = 1
			while currNum < nums[i]:
				currInc = base11(currNum) + base11(nums[i] - currNum)
				currDec = base11(nums[i])
				currChange = currInc - currDec
				if currChange > bestChange:
					bestChange = currChange
					bestI = i
					bestNum = currNum
				currNum *= 10
		assert bestI != -1
		nums[bestI] -= bestNum
		nums.append(bestNum)
	print(' '.join(map(str, nums)))


import sys
import math
input = lambda : sys.stdin.readline().strip()
t = int(input())
while t:
	t -= 1
	(s, n) = map(int, input().split())
	ans = [0] * n
	cur = 0
	digits = int(math.log10(s))
	i = 10 ** digits
	while i >= 1:
		while s >= i and s - i >= n - cur - 1:
			ans[cur] += i
			s -= i
			cur += 1
			if cur == n:
				cur = n - 1
		i //= 10
	print(' '.join(map(str, ans)))


def solve_too_few(S, n):
	i = 0
	rest = -1
	while sum(S) != n:
		while i == 0 or S[i] == 0:
			i += 1
		if sum(S) - 1 + 10 >= n:
			diff = n - sum(S)
			S[i] -= 1
			S[i - 1] += diff
			rest = (10 - diff) * 10 ** (i - 1)
			break
		else:
			S[i] -= 1
			S[i - 1] += 10
			i -= 1
	partitioning = []
	for i in range(len(S)):
		partitioning += [str(10 ** i)] * S[i]
	if rest != -1:
		partitioning.append(str(rest))
	return partitioning

def solve_enough(S, n):
	Y = 1
	i = 0
	partitioning = []
	while Y != n:
		while S[i] == 0:
			i += 1
		partitioning.append(str(10 ** i))
		S[i] -= 1
		Y += 1
	rest = 0
	while i < len(S):
		rest += S[i] * 10 ** i
		i += 1
	partitioning.append(str(rest))
	return partitioning

def solve():
	(s, n) = map(int, input().split(' '))
	S = list(map(int, str(s)))[::-1]
	partitioning = solve_enough(S, n) if sum(S) >= n else solve_too_few(S, n)
	print(' '.join(partitioning))

def main():
	t = int(input())
	for _ in range(t):
		solve()
main()


import sys
pl = 1
sys.setrecursionlimit(10 ** 5)
if pl:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('outpt.txt', 'w')

def li():
	return [int(xxx) for xxx in input().split()]

def fi():
	return int(input())

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())

def ff():
	sys.stdout.flush()

def google(tc, *ans):
	print('Case #' + str(tc) + ':', *ans)

def bits(i, n):
	p = bin(i)[2:]
	return (n - len(p)) * '0' + p
t = fi()
f = t

def rec(s, d, tot):
	if s == 0:
		return tot >= n
	if d < 0:
		return False
	p = 10 ** d
	for j in range(9 * n, -1, -1):
		if s >= p * j:
			if rec(s - p * j, d - 1, tot + j):
				ans[d] = j
				return True
	return False
while t:
	t -= 1
	(s, n) = mi()
	ans = [0] * 12
	rec(s, 11, 0)
	d = [0] * n
	j = 0
	for i in range(n):
		if ans[j] == 0:
			while ans[j] == 0:
				j += 1
		d[i] += 10 ** j
		ans[j] -= 1
	for j in range(11):
		d[0] += ans[j] * 10 ** j
	c = 0
	for i in range(n):
		c += int(str(d[i]), 11)
	print(*d)


def divisors(M):
	d = []
	i = 1
	while M >= i ** 2:
		if M % i == 0:
			d.append(i)
			if i ** 2 != M:
				d.append(M // i)
		i = i + 1
	return d

def popcount(x):
	x = x - (x >> 1 & 1431655765)
	x = (x & 858993459) + (x >> 2 & 858993459)
	x = x + (x >> 4) & 252645135
	x = x + (x >> 8)
	x = x + (x >> 16)
	return x & 127

def eratosthenes(n):
	res = [0 for i in range(n + 1)]
	prime = set([])
	for i in range(2, n + 1):
		if not res[i]:
			prime.add(i)
			for j in range(1, n // i + 1):
				res[i * j] = 1
	return prime

def factorization(n):
	res = []
	for p in prime:
		if n % p == 0:
			while n % p == 0:
				n //= p
			res.append(p)
	if n != 1:
		res.append(n)
	return res

def euler_phi(n):
	res = n
	for x in range(2, n + 1):
		if x ** 2 > n:
			break
		if n % x == 0:
			res = res // x * (x - 1)
			while n % x == 0:
				n //= x
	if n != 1:
		res = res // n * (n - 1)
	return res

def ind(b, n):
	res = 0
	while n % b == 0:
		res += 1
		n //= b
	return res

def isPrimeMR(n):
	d = n - 1
	d = d // (d & -d)
	L = [2, 3, 5, 7, 11, 13, 17]
	for a in L:
		t = d
		y = pow(a, t, n)
		if y == 1:
			continue
		while y != n - 1:
			y = y * y % n
			if y == 1 or t == n - 1:
				return 0
			t <<= 1
	return 1

def findFactorRho(n):
	from math import gcd
	m = 1 << n.bit_length() // 8
	for c in range(1, 99):
		f = lambda x: (x * x + c) % n
		(y, r, q, g) = (2, 1, 1, 1)
		while g == 1:
			x = y
			for i in range(r):
				y = f(y)
			k = 0
			while k < r and g == 1:
				ys = y
				for i in range(min(m, r - k)):
					y = f(y)
					q = q * abs(x - y) % n
				g = gcd(q, n)
				k += m
			r <<= 1
		if g == n:
			g = 1
			while g == 1:
				ys = f(ys)
				g = gcd(abs(x - ys), n)
		if g < n:
			if isPrimeMR(g):
				return g
			elif isPrimeMR(n // g):
				return n // g
			return findFactorRho(g)

def primeFactor(n):
	i = 2
	ret = {}
	rhoFlg = 0
	while i * i <= n:
		k = 0
		while n % i == 0:
			n //= i
			k += 1
		if k:
			ret[i] = k
		i += 1 + i % 2
		if i == 101 and n >= 2 ** 20:
			while n > 1:
				if isPrimeMR(n):
					(ret[n], n) = (1, 1)
				else:
					rhoFlg = 1
					j = findFactorRho(n)
					k = 0
					while n % j == 0:
						n //= j
						k += 1
					ret[j] = k
	if n > 1:
		ret[n] = 1
	if rhoFlg:
		ret = {x: ret[x] for x in sorted(ret)}
	return ret

def divisors(n):
	res = [1]
	prime = primeFactor(n)
	for p in prime:
		newres = []
		for d in res:
			for j in range(prime[p] + 1):
				newres.append(d * p ** j)
		res = newres
	res.sort()
	return res

def xorfactorial(num):
	if num == 0:
		return 0
	elif num == 1:
		return 1
	elif num == 2:
		return 3
	elif num == 3:
		return 0
	else:
		x = baseorder(num)
		return 2 ** x * ((num - 2 ** x + 1) % 2) + function(num - 2 ** x)

def xorconv(n, X, Y):
	if n == 0:
		res = [X[0] * Y[0] % mod]
		return res
	x = [X[i] + X[i + 2 ** (n - 1)] for i in range(2 ** (n - 1))]
	y = [Y[i] + Y[i + 2 ** (n - 1)] for i in range(2 ** (n - 1))]
	z = [X[i] - X[i + 2 ** (n - 1)] for i in range(2 ** (n - 1))]
	w = [Y[i] - Y[i + 2 ** (n - 1)] for i in range(2 ** (n - 1))]
	res1 = xorconv(n - 1, x, y)
	res2 = xorconv(n - 1, z, w)
	former = [(res1[i] + res2[i]) * inv for i in range(2 ** (n - 1))]
	latter = [(res1[i] - res2[i]) * inv for i in range(2 ** (n - 1))]
	former = list(map(lambda x: x % mod, former))
	latter = list(map(lambda x: x % mod, latter))
	return former + latter

def merge_sort(A, B):
	(pos_A, pos_B) = (0, 0)
	(n, m) = (len(A), len(B))
	res = []
	while pos_A < n and pos_B < m:
		(a, b) = (A[pos_A], B[pos_B])
		if a < b:
			res.append(a)
			pos_A += 1
		else:
			res.append(b)
			pos_B += 1
	res += A[pos_A:]
	res += B[pos_B:]
	return res

class UnionFindVerSize:

	def __init__(self, N):
		self._parent = [n for n in range(0, N)]
		self._size = [1] * N
		self.group = N

	def find_root(self, x):
		if self._parent[x] == x:
			return x
		self._parent[x] = self.find_root(self._parent[x])
		stack = [x]
		while self._parent[stack[-1]] != stack[-1]:
			stack.append(self._parent[stack[-1]])
		for v in stack:
			self._parent[v] = stack[-1]
		return self._parent[x]

	def unite(self, x, y):
		gx = self.find_root(x)
		gy = self.find_root(y)
		if gx == gy:
			return
		self.group -= 1
		if self._size[gx] < self._size[gy]:
			self._parent[gx] = gy
			self._size[gy] += self._size[gx]
		else:
			self._parent[gy] = gx
			self._size[gx] += self._size[gy]

	def get_size(self, x):
		return self._size[self.find_root(x)]

	def is_same_group(self, x, y):
		return self.find_root(x) == self.find_root(y)

class WeightedUnionFind:

	def __init__(self, N):
		self.parent = [i for i in range(N)]
		self.size = [1 for i in range(N)]
		self.val = [0 for i in range(N)]
		self.flag = True
		self.edge = [[] for i in range(N)]

	def dfs(self, v, pv):
		stack = [(v, pv)]
		new_parent = self.parent[pv]
		while stack:
			(v, pv) = stack.pop()
			self.parent[v] = new_parent
			for (nv, w) in self.edge[v]:
				if nv != pv:
					self.val[nv] = self.val[v] + w
					stack.append((nv, v))

	def unite(self, x, y, w):
		if not self.flag:
			return
		if self.parent[x] == self.parent[y]:
			self.flag = self.val[x] - self.val[y] == w
			return
		if self.size[self.parent[x]] > self.size[self.parent[y]]:
			self.edge[x].append((y, -w))
			self.edge[y].append((x, w))
			self.size[x] += self.size[y]
			self.val[y] = self.val[x] - w
			self.dfs(y, x)
		else:
			self.edge[x].append((y, -w))
			self.edge[y].append((x, w))
			self.size[y] += self.size[x]
			self.val[x] = self.val[y] + w
			self.dfs(x, y)

class Dijkstra:

	class Edge:

		def __init__(self, _to, _cost):
			self.to = _to
			self.cost = _cost

	def __init__(self, V):
		self.G = [[] for i in range(V)]
		self._E = 0
		self._V = V

	@property
	def E(self):
		return self._E

	@property
	def V(self):
		return self._V

	def add_edge(self, _from, _to, _cost):
		self.G[_from].append(self.Edge(_to, _cost))
		self._E += 1

	def shortest_path(self, s):
		import heapq
		que = []
		d = [10 ** 15] * self.V
		d[s] = 0
		heapq.heappush(que, (0, s))
		while len(que) != 0:
			(cost, v) = heapq.heappop(que)
			if d[v] < cost:
				continue
			for i in range(len(self.G[v])):
				e = self.G[v][i]
				if d[e.to] > d[v] + e.cost:
					d[e.to] = d[v] + e.cost
					heapq.heappush(que, (d[e.to], e.to))
		return d

def Z_algorithm(s):
	N = len(s)
	Z_alg = [0] * N
	Z_alg[0] = N
	i = 1
	j = 0
	while i < N:
		while i + j < N and s[j] == s[i + j]:
			j += 1
		Z_alg[i] = j
		if j == 0:
			i += 1
			continue
		k = 1
		while i + k < N and k + Z_alg[k] < j:
			Z_alg[i + k] = Z_alg[k]
			k += 1
		i += k
		j -= k
	return Z_alg

class BIT:

	def __init__(self, n, mod=0):
		self.BIT = [0] * (n + 1)
		self.num = n
		self.mod = mod

	def query(self, idx):
		res_sum = 0
		mod = self.mod
		while idx > 0:
			res_sum += self.BIT[idx]
			if mod:
				res_sum %= mod
			idx -= idx & -idx
		return res_sum

	def update(self, idx, x):
		mod = self.mod
		while idx <= self.num:
			self.BIT[idx] += x
			if mod:
				self.BIT[idx] %= mod
			idx += idx & -idx
		return

class dancinglink:

	def __init__(self, n, debug=False):
		self.n = n
		self.debug = debug
		self._left = [i - 1 for i in range(n)]
		self._right = [i + 1 for i in range(n)]
		self.exist = [True for i in range(n)]

	def pop(self, k):
		if self.debug:
			assert self.exist[k]
		L = self._left[k]
		R = self._right[k]
		if L != -1:
			if R != self.n:
				(self._right[L], self._left[R]) = (R, L)
			else:
				self._right[L] = self.n
		elif R != self.n:
			self._left[R] = -1
		self.exist[k] = False

	def left(self, idx, k=1):
		if self.debug:
			assert self.exist[idx]
		res = idx
		while k:
			res = self._left[res]
			if res == -1:
				break
			k -= 1
		return res

	def right(self, idx, k=1):
		if self.debug:
			assert self.exist[idx]
		res = idx
		while k:
			res = self._right[res]
			if res == self.n:
				break
			k -= 1
		return res

class SparseTable:

	def __init__(self, A, merge_func, ide_ele):
		N = len(A)
		n = N.bit_length()
		self.table = [[ide_ele for i in range(n)] for i in range(N)]
		self.merge_func = merge_func
		for i in range(N):
			self.table[i][0] = A[i]
		for j in range(1, n):
			for i in range(0, N - 2 ** j + 1):
				f = self.table[i][j - 1]
				s = self.table[i + 2 ** (j - 1)][j - 1]
				self.table[i][j] = self.merge_func(f, s)

	def query(self, s, t):
		b = t - s + 1
		m = b.bit_length() - 1
		return self.merge_func(self.table[s][m], self.table[t - 2 ** m + 1][m])

class BinaryTrie:

	class node:

		def __init__(self, val):
			self.left = None
			self.right = None
			self.max = val

	def __init__(self):
		self.root = self.node(-10 ** 15)

	def append(self, key, val):
		pos = self.root
		for i in range(29, -1, -1):
			pos.max = max(pos.max, val)
			if key >> i & 1:
				if pos.right is None:
					pos.right = self.node(val)
					pos = pos.right
				else:
					pos = pos.right
			elif pos.left is None:
				pos.left = self.node(val)
				pos = pos.left
			else:
				pos = pos.left
		pos.max = max(pos.max, val)

	def search(self, M, xor):
		res = -10 ** 15
		pos = self.root
		for i in range(29, -1, -1):
			if pos is None:
				break
			if M >> i & 1:
				if xor >> i & 1:
					if pos.right:
						res = max(res, pos.right.max)
					pos = pos.left
				else:
					if pos.left:
						res = max(res, pos.left.max)
					pos = pos.right
			elif xor >> i & 1:
				pos = pos.right
			else:
				pos = pos.left
		if pos:
			res = max(res, pos.max)
		return res

def solveequation(edge, ans, n, m):
	x = [0] * m
	used = [False] * n
	for v in range(n):
		if used[v]:
			continue
		y = dfs(v)
		if y != 0:
			return False
	return x

	def dfs(v):
		used[v] = True
		r = ans[v]
		for (to, dire, id) in edge[v]:
			if used[to]:
				continue
			y = dfs(to)
			if dire == -1:
				x[id] = y
			else:
				x[id] = -y
			r += y
		return r

class SegmentTree:

	def __init__(self, init_val, segfunc, ide_ele):
		n = len(init_val)
		self.segfunc = segfunc
		self.ide_ele = ide_ele
		self.num = 1 << (n - 1).bit_length()
		self.tree = [ide_ele] * 2 * self.num
		self.size = n
		for i in range(n):
			self.tree[self.num + i] = init_val[i]
		for i in range(self.num - 1, 0, -1):
			self.tree[i] = self.segfunc(self.tree[2 * i], self.tree[2 * i + 1])

	def update(self, k, x):
		k += self.num
		self.tree[k] = x
		while k > 1:
			self.tree[k >> 1] = self.segfunc(self.tree[k], self.tree[k ^ 1])
			k >>= 1

	def query(self, l, r):
		if r == self.size:
			r = self.num
		res = self.ide_ele
		l += self.num
		r += self.num
		while l < r:
			if l & 1:
				res = self.segfunc(res, self.tree[l])
				l += 1
			if r & 1:
				res = self.segfunc(res, self.tree[r - 1])
			l >>= 1
			r >>= 1
		return res

	def bisect_l(self, l, r, x):
		l += self.num
		r += self.num
		Lmin = -1
		Rmin = -1
		while l < r:
			if l & 1:
				if self.tree[l] <= x and Lmin == -1:
					Lmin = l
				l += 1
			if r & 1:
				if self.tree[r - 1] <= x:
					Rmin = r - 1
			l >>= 1
			r >>= 1
		if Lmin != -1:
			pos = Lmin
			while pos < self.num:
				if self.tree[2 * pos] <= x:
					pos = 2 * pos
				else:
					pos = 2 * pos + 1
			return pos - self.num
		elif Rmin != -1:
			pos = Rmin
			while pos < self.num:
				if self.tree[2 * pos] <= x:
					pos = 2 * pos
				else:
					pos = 2 * pos + 1
			return pos - self.num
		else:
			return -1
import sys, random, bisect
from collections import deque, defaultdict
from heapq import heapify, heappop, heappush
from itertools import permutations
from math import gcd, log
input = lambda : sys.stdin.readline().rstrip()
mi = lambda : map(int, input().split())
li = lambda : list(mi())
for _ in range(int(input())):
	(s, n) = mi()
	A = [0 for i in range(10)]
	for i in range(10):
		A[i] = s % 10
		s //= 10
	res = []
	for i in range(10):
		t = pow(10, i)
		res += [t] * A[i]
	if len(res) >= n:
		res = res[:n - 1] + [sum((res[i] for i in range(n - 1, len(res))))]
		print(*res)
		continue
	one = [1] * A[0]
	res = [a for a in res if a != 1]
	cnt = len(one) + len(res)
	heapify(res)
	while cnt < n:
		a = heappop(res)
		cnt -= 1
		if a == 10:
			cnt += 10
			one += [1] * 10
		else:
			cnt += 10
			for i in range(10):
				heappush(res, a // 10)
	res += one
	res = res[:n - 1] + [sum((res[i] for i in range(n - 1, len(res))))]
	print(*res)


import sys
input = lambda : sys.stdin.readline().strip()

def solve():
	(s, n) = map(int, input().split())
	q = []
	b = 1
	while s:
		for _ in range(s % 10):
			q.append(b)
		b *= 10
		s //= 10
	q.reverse()
	res = []
	while q and q[-1] == 1:
		res.append(q.pop())
	while len(q) + len(res) < n:
		x = q.pop()
		for _ in range(10):
			q.append(x // 10)
		while q and q[-1] == 1:
			res.append(q.pop())
	res = q + res
	res[n - 1:] = [sum(res[n - 1:])]
	return res
for _ in range(int(input())):
	print(*solve())


def solver(s, n):
	num = 10 ** (len(str(s)) - 1)
	for i in range(n - 1):
		while s - num < n - (i + 1):
			num //= 10
		print(num, end=' ')
		s -= num
	print(s)
T = int(input())
for t in range(T):
	(S, N) = map(int, input().split())
	solver(S, N)


import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq

def input():
	return sys.stdin.readline()[:-1]
INF = 10 ** 10

def solve(S, N):
	s = S
	result = []
	for n in range(N):
		if n == N - 1:
			result.append(s)
		else:
			s1 = str(s)
			for i in range(len(s1)):
				v = 10 ** (len(s1) - i - 1)
				if N - n - 1 <= s - v:
					result.append(v)
					s -= v
					break
	return result
T0 = int(input())
for _ in range(T0):
	(S, N) = map(int, input().split())
	print(*solve(S, N))


tests = int(input())
for _ in range(tests):
	(s, n) = input().split()
	n = int(n)
	if n == 1:
		print(s)
		continue
	splited = []
	for i in range(len(s)):
		for _ in range(int(s[-i - 1])):
			splited.append(int('1' + '0' * i))
	splited.sort(reverse=True)
	while splited[-1] == 0:
		splited.pop()
	while n > len(splited):
		index_to_split = len(splited) - 1
		while splited[index_to_split] == 1:
			index_to_split -= 1
		num_to_split = splited[index_to_split]
		k = num_to_split
		while k > 10:
			k //= 10
		splited = splited[:index_to_split] + [num_to_split // k for _ in range(k)] + splited[index_to_split + 1:]
	for i in range(n - 1):
		print(splited[-i - 1], end=' ')
	print(sum(splited[:1 - n]))


t = int(input())
for i in range(t):
	(s, n) = map(int, input().split())
	while n > 1:
		n -= 1
		j = len(str(s))
		while j > -1:
			if s - 10 ** j >= n:
				print(10 ** j, end=' ')
				s -= 10 ** j
				break
			j -= 1
	print(s)


def solve():
	(n, s) = map(lambda x: int(x), input().split(' '))
	st = ''
	for i in range(s - 1, 0, -1):
		x = n - i
		l = pow(10, len(str(x)) - 1)
		st += f'{l} '
		n -= l
	st += f'{n} '
	print(st)
test = int(input())
while test > 0:
	solve()
	test -= 1


t = int(input())
for _ in range(t):
	(s, n) = map(int, input().split())
	p = 1
	while s >= p:
		p *= 10
	p //= 10
	answer = []
	for i in range(n - 1):
		while s - p < n - (i + 1):
			p //= 10
		s -= p
		answer.append(p)
	answer.append(s)
	print(' '.join(map(str, answer)))


def solve(s, n):

	def _power10(x):
		if x == 1:
			return False
		while x > 1:
			if x % 10 > 0:
				return False
			x //= 10
		return x == 1

	def _mult(x):
		m = 1
		while x > 0 and x % 10 == 0:
			m *= 10
			x //= 10
		return m
	sol = [(s, _mult(s))]
	while len(sol) < n:
		(done, xm) = (False, float('inf'))
		for (x, mult) in sol:
			if x > 1 and (not _power10(x)):
				sol.remove((x, mult))
				sol.extend([(x - mult, _mult(x - mult)), (mult, mult)])
				done = True
				break
			elif x > 1:
				xm = min(xm, x)
		if not done:
			(x, mult) = (xm, _mult(xm))
			sol.remove((x, mult))
			sol.extend([(x // 10, mult // 10), (9 * x // 10, mult // 10)])
	return list(map(lambda x: x[0], sol))
t = int(input())
for _ in range(t):
	(s, n) = map(int, input().split())
	print(' '.join(map(str, solve(s, n))))


import sys
input = iter(sys.stdin.read().splitlines()).__next__

def solve():
	(s, n) = map(int, input().split())
	nums = []
	digit = 10 ** (len(str(s)) - 1)
	while n > 1:
		if s - digit >= n - 1:
			nums.append(digit)
			s -= digit
			n -= 1
		else:
			digit //= 10
	nums.append(s)
	return ' '.join(map(str, nums))
t = int(input())
output = []
for _ in range(t):
	output.append(solve())
print(*output, sep='\n')


import collections
import math
import itertools
import sys
import time

def fast_input():
	return sys.stdin.readline().strip()
input = fast_input

def ints_input():
	return list((int(x) for x in input().split()))

def int_input():
	return int(input())

def solve():
	(s, n) = ints_input()
	digits = [int(d) for d in str(s)]
	while sum(digits) < n:
		i = len(digits) - 2
		while digits[i] == 0:
			i -= 1
		digits[i] -= 1
		digits[i + 1] += 10
	answers = [0 for _ in range(n)]
	done = 0
	for (i, d) in enumerate(digits[::-1]):
		left = d
		for _ in range(d):
			if done < n:
				answers[done] += 10 ** i
				done += 1
				left -= 1
		answers[0] += left * 10 ** i
	print(' '.join([str(x) for x in answers]))
if True:
	for _ in range(int_input()):
		solve()
else:
	solve()


import os
import sys
import math
from io import BytesIO, IOBase
import io
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
from collections import Counter
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: max(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree1:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)
MOD = 10 ** 9 + 7

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
mod = 10 ** 9 + 7
omod = 998244353
prime = [True for i in range(10001)]
prime[0] = prime[1] = False

def SieveOfEratosthenes(n=10000):
	p = 2
	c = 0
	while p <= n:
		if prime[p] == True:
			c += 1
			for i in range(p, n + 1, p):
				prime[i] = False
		p += 1

class DSU:

	def __init__(self, R, C):
		self.par = range(R * C + 1)
		self.rnk = [0] * (R * C + 1)
		self.sz = [1] * (R * C + 1)

	def find(self, x):
		if self.par[x] != x:
			self.par[x] = self.find(self.par[x])
		return self.par[x]

	def union(self, x, y):
		(xr, yr) = (self.find(x), self.find(y))
		if xr == yr:
			return
		if self.rnk[xr] < self.rnk[yr]:
			(xr, yr) = (yr, xr)
		if self.rnk[xr] == self.rnk[yr]:
			self.rnk[xr] += 1
		self.par[yr] = xr
		self.sz[xr] += self.sz[yr]

	def size(self, x):
		return self.sz[self.find(x)]

	def top(self):
		return self.size(len(self.sz) - 1) - 1

class LazySegTree:

	def __init__(self, _op, _e, _mapping, _composition, _id, v):

		def set(p, x):
			assert 0 <= p < _n
			p += _size
			for i in range(_log, 0, -1):
				_push(p >> i)
			_d[p] = x
			for i in range(1, _log + 1):
				_update(p >> i)

		def get(p):
			assert 0 <= p < _n
			p += _size
			for i in range(_log, 0, -1):
				_push(p >> i)
			return _d[p]

		def prod(l, r):
			assert 0 <= l <= r <= _n
			if l == r:
				return _e
			l += _size
			r += _size
			for i in range(_log, 0, -1):
				if l >> i << i != l:
					_push(l >> i)
				if r >> i << i != r:
					_push(r >> i)
			sml = _e
			smr = _e
			while l < r:
				if l & 1:
					sml = _op(sml, _d[l])
					l += 1
				if r & 1:
					r -= 1
					smr = _op(_d[r], smr)
				l >>= 1
				r >>= 1
			return _op(sml, smr)

		def apply(l, r, f):
			assert 0 <= l <= r <= _n
			if l == r:
				return
			l += _size
			r += _size
			for i in range(_log, 0, -1):
				if l >> i << i != l:
					_push(l >> i)
				if r >> i << i != r:
					_push(r - 1 >> i)
			l2 = l
			r2 = r
			while l < r:
				if l & 1:
					_all_apply(l, f)
					l += 1
				if r & 1:
					r -= 1
					_all_apply(r, f)
				l >>= 1
				r >>= 1
			l = l2
			r = r2
			for i in range(1, _log + 1):
				if l >> i << i != l:
					_update(l >> i)
				if r >> i << i != r:
					_update(r - 1 >> i)

		def _update(k):
			_d[k] = _op(_d[2 * k], _d[2 * k + 1])

		def _all_apply(k, f):
			_d[k] = _mapping(f, _d[k])
			if k < _size:
				_lz[k] = _composition(f, _lz[k])

		def _push(k):
			_all_apply(2 * k, _lz[k])
			_all_apply(2 * k + 1, _lz[k])
			_lz[k] = _id
		_n = len(v)
		_log = _n.bit_length()
		_size = 1 << _log
		_d = [_e] * (2 * _size)
		_lz = [_id] * _size
		for i in range(_n):
			_d[_size + i] = v[i]
		for i in range(_size - 1, 0, -1):
			_update(i)
		self.set = set
		self.get = get
		self.prod = prod
		self.apply = apply
MIL = 1 << 20

def makeNode(total, count):
	return total * MIL + count

def getTotal(node):
	return math.floor(node / MIL)

def getCount(node):
	return node - getTotal(node) * MIL
nodeIdentity = makeNode(0.0, 0.0)

def nodeOp(node1, node2):
	return node1 + node2
	return makeNode(getTotal(node1) + getTotal(node2), getCount(node1) + getCount(node2))
identityMapping = -1

def mapping(tag, node):
	if tag == identityMapping:
		return node
	count = getCount(node)
	return makeNode(tag * count, count)

def composition(mapping1, mapping2):
	return mapping1 if mapping1 != identityMapping else mapping2

class LazySegUpdate:

	def __init__(self, N):
		self.N = N
		n = 4 * N
		self.tree = [0] * n
		self.lazy = [0] * n

	def queryHelper(self, index, s, e, l, r):
		if self.lazy[index]:
			update = self.lazy[index]
			self.lazy[index] = 0
			self.tree[index] = max(self.tree[index], update)
			if s != e:
				self.lazy[2 * index] = max(self.lazy[2 * index], update)
				self.lazy[2 * index + 1] = max(self.lazy[2 * index + 1], update)
		if s > e or s > r or e < l:
			return 0
		if s >= l and e <= r:
			return self.tree[index]
		mid = (s + e) // 2
		return max(self.queryHelper(2 * index, s, mid, l, r), self.queryHelper(2 * index + 1, mid + 1, e, l, r))

	def updateHelper(self, index, s, e, l, r, h):
		if self.lazy[index]:
			update = self.lazy[index]
			self.lazy[index] = 0
			self.tree[index] = max(self.tree[index], update)
			if s != e:
				self.lazy[2 * index] = max(self.lazy[2 * index], update)
				self.lazy[2 * index + 1] = max(self.lazy[2 * index + 1], update)
		if s > e or s > r or e < l:
			return
		if s >= l and e <= r:
			self.tree[index] = max(self.tree[index], h)
			if s != e:
				self.lazy[2 * index] = max(self.lazy[2 * index], h)
				self.lazy[2 * index + 1] = max(self.lazy[2 * index + 1], h)
			return
		mid = (s + e) // 2
		self.updateHelper(2 * index, s, mid, l, r, h)
		self.updateHelper(2 * index + 1, mid + 1, e, l, r, h)
		self.tree[index] = max(self.tree[2 * index], self.tree[2 * index + 1])

	def query(self, l, r):
		return self.queryHelper(1, 0, self.N - 1, l, r - 1)

	def update(self, l, r, h):
		self.updateHelper(1, 0, self.N - 1, l, r - 1, h)

def memodict(f):

	class memodict(dict):

		def __missing__(self, key):
			ret = self[key] = f(key)
			return ret
	return memodict().__getitem__

def pollard_rho(n):
	if n & 1 == 0:
		return 2
	if n % 3 == 0:
		return 3
	s = (n - 1 & 1 - n).bit_length() - 1
	d = n >> s
	for a in [2, 325, 9375, 28178, 450775, 9780504, 1795265022]:
		p = pow(a, d, n)
		if p == 1 or p == n - 1 or a % n == 0:
			continue
		for _ in range(s):
			prev = p
			p = p * p % n
			if p == 1:
				return math.gcd(prev - 1, n)
			if p == n - 1:
				break
		else:
			for i in range(2, n):
				(x, y) = (i, (i * i + 1) % n)
				f = math.gcd(abs(x - y), n)
				while f == 1:
					(x, y) = ((x * x + 1) % n, (y * y + 1) % n)
					y = (y * y + 1) % n
					f = math.gcd(abs(x - y), n)
				if f != n:
					return f
	return n

@memodict
def prime_factors(n):
	if n <= 1:
		return Counter()
	f = pollard_rho(n)
	return Counter([n]) if f == n else prime_factors(f) + prime_factors(n // f)

def distinct_factors(n):
	factors = [1]
	for (p, exp) in prime_factors(n).items():
		factors += [p ** i * factor for factor in factors for i in range(1, exp + 1)]
	return factors

def all_factors(n):
	(small, large) = ([], [])
	for i in range(1, int(n ** 0.5) + 1, 2 if n & 1 else 1):
		if not n % i:
			small.append(i)
			large.append(n // i)
	if small[-1] == large[-1]:
		large.pop()
	large.reverse()
	small.extend(large)
	return small

class SortedList:

	def __init__(self, iterable=[], _load=200):
		values = sorted(iterable)
		self._len = _len = len(values)
		self._load = _load
		self._lists = _lists = [values[i:i + _load] for i in range(0, _len, _load)]
		self._list_lens = [len(_list) for _list in _lists]
		self._mins = [_list[0] for _list in _lists]
		self._fen_tree = []
		self._rebuild = True

	def _fen_build(self):
		self._fen_tree[:] = self._list_lens
		_fen_tree = self._fen_tree
		for i in range(len(_fen_tree)):
			if i | i + 1 < len(_fen_tree):
				_fen_tree[i | i + 1] += _fen_tree[i]
		self._rebuild = False

	def _fen_update(self, index, value):
		if not self._rebuild:
			_fen_tree = self._fen_tree
			while index < len(_fen_tree):
				_fen_tree[index] += value
				index |= index + 1

	def _fen_query(self, end):
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		x = 0
		while end:
			x += _fen_tree[end - 1]
			end &= end - 1
		return x

	def _fen_findkth(self, k):
		_list_lens = self._list_lens
		if k < _list_lens[0]:
			return (0, k)
		if k >= self._len - _list_lens[-1]:
			return (len(_list_lens) - 1, k + _list_lens[-1] - self._len)
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		idx = -1
		for d in reversed(range(len(_fen_tree).bit_length())):
			right_idx = idx + (1 << d)
			if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:
				idx = right_idx
				k -= _fen_tree[idx]
		return (idx + 1, k)

	def _delete(self, pos, idx):
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len -= 1
		self._fen_update(pos, -1)
		del _lists[pos][idx]
		_list_lens[pos] -= 1
		if _list_lens[pos]:
			_mins[pos] = _lists[pos][0]
		else:
			del _lists[pos]
			del _list_lens[pos]
			del _mins[pos]
			self._rebuild = True

	def _loc_left(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(lo, pos) = (-1, len(_lists) - 1)
		while lo + 1 < pos:
			mi = lo + pos >> 1
			if value <= _mins[mi]:
				pos = mi
			else:
				lo = mi
		if pos and value <= _lists[pos - 1][-1]:
			pos -= 1
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value <= _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def _loc_right(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(pos, hi) = (0, len(_lists))
		while pos + 1 < hi:
			mi = pos + hi >> 1
			if value < _mins[mi]:
				hi = mi
			else:
				pos = mi
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value < _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def add(self, value):
		_load = self._load
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len += 1
		if _lists:
			(pos, idx) = self._loc_right(value)
			self._fen_update(pos, 1)
			_list = _lists[pos]
			_list.insert(idx, value)
			_list_lens[pos] += 1
			_mins[pos] = _list[0]
			if _load + _load < len(_list):
				_lists.insert(pos + 1, _list[_load:])
				_list_lens.insert(pos + 1, len(_list) - _load)
				_mins.insert(pos + 1, _list[_load])
				_list_lens[pos] = _load
				del _list[_load:]
				self._rebuild = True
		else:
			_lists.append([value])
			_mins.append(value)
			_list_lens.append(1)
			self._rebuild = True

	def discard(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_right(value)
			if idx and _lists[pos][idx - 1] == value:
				self._delete(pos, idx - 1)

	def remove(self, value):
		_len = self._len
		self.discard(value)
		if _len == self._len:
			raise ValueError('{0!r} not in list'.format(value))

	def pop(self, index=-1):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		value = self._lists[pos][idx]
		self._delete(pos, idx)
		return value

	def bisect_left(self, value):
		(pos, idx) = self._loc_left(value)
		return self._fen_query(pos) + idx

	def bisect_right(self, value):
		(pos, idx) = self._loc_right(value)
		return self._fen_query(pos) + idx

	def count(self, value):
		return self.bisect_right(value) - self.bisect_left(value)

	def __len__(self):
		return self._len

	def __getitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		return self._lists[pos][idx]

	def __delitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		self._delete(pos, idx)

	def __contains__(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_left(value)
			return idx < len(_lists[pos]) and _lists[pos][idx] == value
		return False

	def __iter__(self):
		return (value for _list in self._lists for value in _list)

	def __reversed__(self):
		return (value for _list in reversed(self._lists) for value in reversed(_list))

	def __repr__(self):
		return 'SortedList({0})'.format(list(self))

def binarySearch(arr, n, key):
	left = 0
	right = n - 1
	mid = 0
	res = n
	while left <= right:
		mid = (right + left) // 2
		if arr[mid] > key:
			res = mid
			right = mid - 1
		else:
			left = mid + 1
	return res

def binarySearch1(arr, n, key):
	left = 0
	right = n - 1
	mid = 0
	res = -1
	while left <= right:
		mid = (right + left) // 2
		if arr[mid] > key:
			right = mid - 1
		else:
			res = mid
			left = mid + 1
	return res
t = 1
t = int(input())
for _ in range(t):
	(s, n) = map(int, input().split())
	ans = []
	x = 10 ** (len(str(s)) - 1)
	for i in range(n - 1):
		while s - x < n - (i + 1):
			x //= 10
		ans.append(x)
		s -= x
	ans.append(s)
	print(*ans)


from io import BytesIO, IOBase
import sys
import math
import os
import heapq
from collections import defaultdict, deque
from math import ceil
from bisect import bisect_left, bisect_right
from time import perf_counter
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def mint():
	return map(int, input().split())

def mfloat():
	return map(float, input().split())

def intin():
	return int(input())

def solve():
	(total, n) = input().split()
	n = int(n)
	total = [int(i) for i in total]
	easy = sum(total)
	numbers = [[0] * len(total) for i in range(n)]
	for i in range(len(total) - 2, -1, -1):
		if total[i]:
			msb = i
			break
	while easy < n:
		easy += 9
		total[msb] -= 1
		total[msb + 1] += 10
		msb += msb != len(total) - 2
		if not total[msb] and easy < n:
			while not total[msb]:
				msb -= 1
	index = 0
	for i in range(len(total)):
		while total[i]:
			total[i] -= 1
			numbers[index][i] += 1
			index = (index + 1) % n
	ans = [0] * n
	for (index, number) in enumerate(numbers):
		factor = 1
		for j in range(len(number) - 1, -1, -1):
			ans[index] += number[j] * factor
			factor *= 10
	print(*ans)

def main():
	t = 1
	t = int(input())
	for _ in range(t):
		solve()
start_time = perf_counter()
main()
print(perf_counter() - start_time, file=sys.stderr)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict, deque
import sys
import os, sys
from io import BytesIO, IOBase
from bisect import bisect, insort
from array import array
for _ in range(int(input())):
	(s, n) = input().split()
	n = int(n)
	ints = int(s)
	summ = 0
	for i in s:
		summ += int(i)
	l = len(s)
	ans = []
	if summ >= n:
		for i in range(len(s)):
			if s[i] != '0':
				for j in range(int(s[i])):
					ans.append(10 ** (l - i - 1))
		till = 0
		fin = []
		times = 0
		for i in ans:
			if times == n - 1:
				fin.append(ints - till)
				break
			else:
				times += 1
				fin.append(i)
				till += i
		print(*fin)
	else:
		for i in range(len(s)):
			if s[i] != '0':
				for j in range(int(s[i])):
					ans.append(10 ** (l - i - 1))
		while len(ans) < n:
			leng = len(ans)
			ans.sort()
			for i in range(len(ans)):
				if ans[i] > 1:
					val = ans[i]
					ans[i] = val // 10
					for j in range(9):
						ans.append(val // 10)
					break
		till = 0
		ans.sort(reverse=True)
		fin = []
		times = 0
		for i in ans:
			if times == n - 1:
				fin.append(ints - till)
				break
			else:
				times += 1
				fin.append(i)
				till += i
		print(*fin)


for i in range(int(input())):
	(s, n) = list(map(int, input().split()))
	z = len(str(s))
	a = []
	for i in range(z):
		a.append(s // 10 ** i % 10)
	a = a[::-1]
	b1 = []
	b2 = [0]
	while sum(a) < n:
		for j in range(z - 2, -1, -1):
			if a[j] > 0:
				a[j] -= 1
				a[j + 1] += 10
				break
	for i in range(z):
		for j in range(a[i]):
			b1.append(10 ** (z - 1 - i))
	for i in range(len(b1) - n + 1):
		b2[0] += b1[i]
	for i in range(len(b1) - n + 1, len(b1)):
		b2.append(b1[i])
	print(*b2)


import sys
import bisect
from bisect import bisect_left as lb
from bisect import bisect_right as rb
input_ = lambda : sys.stdin.readline().strip('\r\n')
from math import log
from math import gcd
from math import atan2, acos
from random import randint
sa = lambda : input_()
sb = lambda : int(input_())
sc = lambda : input_().split()
sd = lambda : list(map(int, input_().split()))
sflo = lambda : list(map(float, input_().split()))
se = lambda : float(input_())
sf = lambda : list(input_())
flsh = lambda : sys.stdout.flush()
mod = 10 ** 9 + 7
mod1 = 998244353
gp = []
cost = []
dp = []
mx = []
ans1 = []
ans2 = []
special = []
specnode = []
a = 0
kthpar = []

def dfs2(root, par):
	if par != -1:
		dp[root] = dp[par] + 1
	for i in range(1, 20):
		if kthpar[root][i - 1] != -1:
			kthpar[root][i] = kthpar[kthpar[root][i - 1]][i - 1]
	for child in gp[root]:
		if child == par:
			continue
		kthpar[child][0] = root
		dfs(child, root)
ans = 0
b = []
vis = []
tot = 0
time = []
time1 = []
adj = []
mx = -1
eps = 1e-07

def hnbhai(tc):
	(s, n) = sd()
	ans = [s]
	while len(ans) < n:
		x = -1
		for i in range(len(ans)):
			if str(ans[i]) != '1' + '0' * len(str(ans[i])[1:]):
				x = ans[i]
				ans.pop(i)
				break
		if x == -1:
			mn = float('inf')
			for i in range(len(ans)):
				if ans[i] != 1:
					mn = min(ans[i], mn)
			for i in range(len(ans)):
				if ans[i] == mn:
					ans.pop(i)
					x = mn
					break
		are = 1
		while are < x:
			are *= 10
		ans.append(are // 10)
		ans.append(x - are // 10)
	print(*ans)
for _ in range(sb()):
	hnbhai(_ + 1)


import bisect
import heapq
import math
import collections
import sys
import copy
from functools import reduce
import decimal
from io import BytesIO, IOBase
import os
import itertools
import functools
from types import GeneratorType
sys.setrecursionlimit(10 ** 9)
decimal.getcontext().rounding = decimal.ROUND_HALF_UP
graphDict = collections.defaultdict
queue = collections.deque

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		to = f(*args, **kwargs)
		if stack:
			return to
		else:
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						return to
					to = stack[-1].send(to)
	return wrappedfunc

class Graphs:

	def __init__(self):
		self.graph = graphDict(set)

	def add_edge(self, u, v):
		self.graph[u].add(v)
		self.graph[v].add(u)

	def dfs_utility(self, nodes, visited_nodes):
		visited_nodes.add(nodes)
		for neighbour in self.graph[nodes]:
			if neighbour not in visited_nodes:
				self.dfs_utility(neighbour, visited_nodes)

	def dfs(self, node):
		Visited = set()
		self.dfs_utility(i, Visited)

	def bfs(self, node, f_node):
		count = float('inf')
		visited = set()
		level = 0
		if node not in visited:
			queue.append([node, level])
			visited.add(node)
		flag = 0
		while queue:
			parent = queue.popleft()
			if parent[0] == f_node:
				flag = 1
				count = min(count, parent[1])
			level = parent[1] + 1
			for item in self.graph[parent[0]]:
				if item not in visited:
					queue.append([item, level])
					visited.add(item)
		return count if flag else -1

class Tree:

	def __init__(self, data):
		self.data = data
		self.left = None
		self.right = None

def inorder(node, lis):
	if node:
		inorder(node.left, lis)
		lis.append(node.data)
		inorder(node.right, lis)
	return lis

def leaf_node_sum(root):
	if root is None:
		return 0
	if root.left is None and root.right is None:
		return root.data
	return leaf_node_sum(root.left) + leaf_node_sum(root.right)

def hight(root):
	if root is None:
		return -1
	if root.left is None and root.right is None:
		return 0
	return max(hight(root.left), hight(root.right)) + 1

class UF:

	def __init__(self, N):
		self._id = list(range(N))
		self._count = N
		self._rank = [0] * N

	def find(self, p):
		id = self._id
		while p != id[p]:
			p = id[p] = id[id[p]]
		return p

	def count(self):
		return self._count

	def connected(self, p, q):
		return self.find(p) == self.find(q)

	def union(self, p, q):
		id = self._id
		rank = self._rank
		i = self.find(p)
		j = self.find(q)
		if i == j:
			return
		self._count -= 1
		if rank[i] < rank[j]:
			id[i] = j
		elif rank[i] > rank[j]:
			id[j] = i
		else:
			id[j] = i
			rank[i] += 1

	def __str__(self):
		return ' '.join([str(x) for x in self._id])

	def __repr__(self):
		return 'UF(' + str(self) + ')'

def rounding(n):
	return int(decimal.Decimal(f'{n}').to_integral_value())

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0), []))

def p_sum(array):
	return list(itertools.accumulate(array))

def diophantine(a: int, b: int, c: int):
	(d, x, y) = extended_gcd(a, b)
	r = c // d
	return (r * x, r * y)

@bootstrap
def extended_gcd(a: int, b: int):
	if b == 0:
		(d, x, y) = (a, 1, 0)
	else:
		(d, p, q) = (yield extended_gcd(b, a % b))
		x = q
		y = p - q * (a // b)
	yield (d, x, y)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, **kwargs):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def inp():
	return sys.stdin.readline().strip()

def map_inp(v_type):
	return map(v_type, inp().split())

def list_inp(v_type):
	return list(map_inp(v_type))
for _ in range(int(inp())):
	(s, n) = map_inp(int)
	ans = []
	count = 0
	for i in range(n):
		cur = 1
		while cur * 10 <= s - (n - i) + 1:
			cur *= 10
		s -= cur
		ans.append(cur)
	if s > 0:
		ans[n - 1] += s
	print(*ans)


import math

def get_max(arr):
	ans1 = None
	ans2 = float('inf')
	idx = 0
	for e in arr:
		s_e = str(e)
		curr_d = 0
		for i in range(len(s_e) - 1, -1, -1):
			j = int(s_e[i])
			if j > 0 and e != 1:
				if curr_d < ans2:
					ans2 = curr_d
					ans1 = idx
			curr_d += 1
		idx += 1
	return (ans1, ans2)

def main(s, n):
	s = str(s)
	nums = [0] * n
	j = 0
	for i in range(len(s)):
		val = int(s[i])
		while val:
			e = nums[j]
			nums[j] = e + pow(10, len(s) - i - 1)
			val -= 1
			j += 1
			j %= n
	nums.sort(reverse=True)
	curr_idx = len(nums) - 1
	while nums[curr_idx] == 0:
		(max_idx, pos) = get_max(nums)
		nums[max_idx] -= pow(10, pos)
		if nums[max_idx] == 0:
			nums[max_idx] += 9 * pow(10, pos - 1)
			nums[curr_idx] += pow(10, pos - 1)
		else:
			nums[curr_idx] += pow(10, pos)
		curr_idx -= 1
	return nums
t = int(input())
ans = []
for i in range(t):
	(s, n) = list(map(int, input().split()))
	ans.append(main(s, n))
for e in ans:
	print(*e)


from sys import stdin, stdout
input = stdin.readline
t = int(input())
for _ in range(t):
	(s, n) = map(int, input().split())
	s = str(s)
	arr = []
	for i in range(n - 1):
		l = len(s)
		k = 0
		while 1:
			k += 1
			p = int(str(1) + str(0) * (l - k))
			if int(s) - p >= n - i - 1:
				arr.append(p)
				s = str(int(s) - p)
				break
	arr.append(int(s))
	print(*arr)