fn main() { let mut t = String::new(); std::io::stdin().read_line(&mut t).ok(); let t: usize = t.trim().parse().unwrap(); let queries = (0..t).map(|_| { let mut temp = String::new(); std::io::stdin().read_line(&mut temp).ok(); let temp: Vec = temp.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); (temp[0], temp[1]) }) .collect::>(); for &(a, b) in queries.iter() { let mut target = a; let mut op = vec![]; for i in 0..60 { if target & ((1usize << (i+1)) - 1) > 0 && target + (1usize << i) <= b { target += 1usize << i; op.push(1usize << i); } } for i in (0..60).rev() { if b & (1usize << i) > 0 && target & (1usize << i) == 0 { target += 1usize << i; op.push(1usize << i); } } println!("{}", op.len()); println!("{}", op.iter().map(|v| v.to_string()).collect::>().join(" ")); } }