import Control.Monad

solvable_adj::[(Int,Int)]->(Bool,Bool)
solvable_adj ((x,y):ps) = let (b:bs) = map (\(x_,y_)->mod (x_ + y_) 2 == 1) ((x,y):ps) in
                          (and (map (b==) bs),mod (x+y) 2 == 0)

bin39::[Int]
bin39 = [2^i|i<-[0..38]]

--関数、終了条件、初期値、リスト
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_39bit::Int->[Bool]
bin_39bit n = let bits = ls_accum (\ i -> (div i 2 , (mod i 2)==1) ) (0==) n in
              bits++(take (39 - (length bits)) (repeat False))

--need odd num
pm_bin_39_bit::Int->[Bool]
pm_bin_39_bit n = bin_39bit (div (n + (2^39 - 1)) 2)

without_adj_1_solver::(Int,Int)->[Char]
without_adj_1_solver (x,y) = (map to_char) (zip (pm_bin_39_bit (x+y)) (pm_bin_39_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::Bool->(Int,Int)->[Char]
adj_1_solver b (x,y) = if not b
                          then without_adj_1_solver (x,y)
                          else 'L':(without_adj_1_solver (x-1,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 "40\n" else "39\n")
                (putStr.((if b then "1 " else [])++).concat.(map ((\x->x++" ").show))) bin39
                putStr "\n"
                forM_ dat (\(x,y)->do
                                  putStr (adj_1_solver b (x,y))
                             )
                putStr "\n"