lines = STDIN.readlines.map {|x| x.chomp.to_i} m = lines.shift ruijou = [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096] m.times do |x| no = lines[x] + 1 route = [] ruijou.reverse_each do |r| if no < r next end if (no - r) % 2 == 0 route.unshift "L" else route.unshift "R" end no /= 2 end puts route.join end