t = int(input())

for i in range(t):
    adds = []
    t = input()
    appends = 0
    for idx, num in enumerate(t):
        if int(num) != 0:
            appends += 1
            adds.append(str(num) + str("0" * (len(t) - idx - 1)))
    print(appends)
    print(" ".join(adds))

d33727679b0a01a86fe4056e0657de1227bc9ded
<mask token>

<mask token>
for i in range(t):
    adds = []
    t = input()
    appends = 0
    for idx, num in enumerate(t):
        if int(num) != 0:
            appends += 1
            adds.append(str(num) + str('0' * (len(t) - idx - 1)))
    print(appends)
    print(' '.join(adds))

t = int(input())
for i in range(t):
    adds = []
    t = input()
    appends = 0
    for idx, num in enumerate(t):
        if int(num) != 0:
            appends += 1
            adds.append(str(num) + str('0' * (len(t) - idx - 1)))
    print(appends)
    print(' '.join(adds))

t = int(input())

for i in range(t):
    adds = []
    t = input()
    appends = 0
    for idx, num in enumerate(t):
        if int(num) != 0:
            appends += 1
            adds.append(str(num) + str("0" * (len(t) - idx - 1)))
    print(appends)
    print(" ".join(adds))
