import scala.annotation.tailrec import scala.collection.mutable.ArrayBuffer import scala.io.StdIn.* import scala.math.* @main def main = val testCase = readLine().toInt for _ <- 0 until testCase do val Array(a, b) = readLine().split(' ').map(_.toLong) var current = a val op = ArrayBuffer[Long]() for i <- 0 until 60 do val d = 1L << i if (current & d) != 0L && current + d <= b then current += d op.addOne(d) for i <- 59 to 0 by -1 do val d = 1L << i if current + d <= b then current += d op.addOne(d) println(op.length) println(op.mkString(" "))