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:
if A%11 != 0:
AA = [A%11,11,11,11]
#A -= A%11
BB = [11]
B -= 11
if B > 10:
BB.append(10)
B -= 10
if B > 10:
BB.append(10)
B -= 10
BB.append(B)
else:
BB += [B,0]
else:
BB += [B,0,0]
else:
AA = [11,11,11]
BB = [10]*(B//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 | 14ms | 3128 KiB | ||||
subtask2 | 20/20 | ||||||
2 | Accepted | 14ms | 3128 KiB | ||||
subtask3 | 0/30 | ||||||
3 | Wrong answer | 17ms | 3080 KiB | ||||
subtask4 | 0/50 | ||||||
4 | Wrong answer | 30ms | 3128 KiB | ||||
5 | Wrong answer | 32ms | 3168 KiB | ||||
6 | Wrong answer | 35ms | 3128 KiB |