T = int(input()) MAX_COUNT = 120 for _ in range(T): A,B = map(int,input().split()) count = 0 flg = False l = [] while count < MAX_COUNT: for m in range(A,0,-1): if A%m == 0: if A+m <= B: A += m l.append(m) count += 1 if A == B: flg = True break if flg: print(len(l)) print(*l) break