local ffi = require("ffi") local C = ffi.C ffi.cdef[[ long long atoll(const char*); ]] local function lltonumber(str) return C.atoll(str) end local function solve() local a, b = io.read():match("(%d+) (%d+)") a = lltonumber(a) b = lltonumber(b) local t = {} while a < b do local diff = b - a local mul = 1LL local tgt = 1LL while true do local v = mul + b % mul if diff < v then break end tgt = mul mul = mul + mul end mul = 1LL local v = tgt + b % tgt b = b - v while 0LL < v do if v % 2LL == 1LL then table.insert(t, mul) end v = v / 2LL mul = mul + mul end end print(#t) for i = #t, 1, -1 do local str = tostring(t[i]):gsub("LL", "") io.write(str) io.write(i == 1 and "\n" or " ") end end local q = io.read("*n", "*l") for iq = 1, q do solve() end