import Control.Monad

solvable_adj::[(Int,Int)]->(Bool,Bool)
solvable_adj ls = let (i:rest) = (map (\(x,y)->mod (x+y) 2) ls) in
                  (and (map (i==) rest),i==0)

bin31::[Int]
bin31 = [2^i|i<-[0..30]]

--関数、終了条件、初期値、リスト
ls_accum::(b->(b,c))->(b->Bool)->b->[c]
ls_accum f condition state = if condition state then [] else let (next,res) = f state  in res:(ls_accum f condition next)

bin_31bit::Int->[Bool]
bin_31bit n = let bits = ls_accum (\ i -> (div i 2 , (mod i 2)==1) ) (0==) n in
              bits++(take (31 - (length bits)) (repeat False))

bin_31bit_t::[Bool]->Int
bin_31bit_t = sum.(map (\(i,b)->if b then 2^i else 0)).(zip [0..30])
--need odd num
pm_bin_31_bit::Int->[Bool]
pm_bin_31_bit n = bin_31bit (div (n + (2^31 - 1)) 2)

pm_bin_31_t::[Bool]->Int
pm_bin_31_t  = sum.(map (\(i,b)->if b then 2^i else (- 2^i))).(zip [0..30])

without_adj_1_solver::(Int,Int)->[Char]
without_adj_1_solver (x,y) = (map to_char) (zip (pm_bin_31_bit (x+y)) (pm_bin_31_bit (x-y)))
                                  where to_char (b,c) = case (b,c) of
                                                        (True,True)  -> 'L'
                                                        (True,False) -> 'U'
                                                        (False,True) -> 'D'
                                                        (False,False)-> 'R'
--修正の必要フラグ
adj_1_solver::(Int,Int)->[Char]
adj_1_solver (x,y) = if mod (x+y) 2 == 1
                          then without_adj_1_solver (x,y)
                          else 'L':(without_adj_1_solver (x-1,y))

solver_test::[Char]->(Int,Int)
solver_test ls =let b = length ls == 32 in
                let fl = if b then (zip [0..30] (tail ls)) else (zip [0..30] ls) in
                let x= sum [(if c == 'L' then 2^i else (-(2^i)))|(i,c)<-fl,c=='L'||c=='R'] in
                let y= sum [(if c == 'U' then 2^i else (-(2^i)))|(i,c)<-fl,c=='U'||c=='D'] in
                ((if b then 1 else 0 )+ x,y)

main::IO()
main=do
  nc<-getLine
  let n = read nc::Int
  dat<- forM [1..n] (\_->(return.(\(x:y:[])->(x,y)).(map read).words)=<<getLine)
  case solvable_adj dat of
    (False,_) -> do
                putStr "-1\n"
    (True,b)->do
                putStr (if b then "32\n" else "31\n")
                (putStr.((if b then "1 " else [])++).concat.(map ((\x->x++" ").show))) bin31
                putStr "\n"
                forM_ dat (\(x,y)->do
                                  putStr (adj_1_solver (x,y))
                                  putStr "\n"
                             )
