N = int(input())
for i in range(N):
A,B = [int(i) for i in input().split()]
if A <= B or A < 33:
print(-1,-1)
else:
AA = [11]*(A//11)
BB = []
if A%11 != 0:
AA = [A%11] + AA
BB = [11]
B -= 11
BB += [B%10] + [10]*(B//10)
BB += [0] * (len(AA)-len(BB))
for i in range(len(AA)):
print(AA[i],BB[i])
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 16ms | 2916 KiB | ||||
subtask2 | 0/20 | ||||||
2 | Wrong answer | 16ms | 3128 KiB | ||||
subtask3 | 0/30 | ||||||
3 | Wrong answer | 18ms | 3128 KiB | ||||
subtask4 | 0/50 | ||||||
4 | Wrong answer | 32ms | 3148 KiB | ||||
5 | Wrong answer | 37ms | 3128 KiB | ||||
6 | Wrong answer | 39ms | 3144 KiB |