dp = [''] 0.upto(2046) { |i| dp[i * 2 + 1] = dp[i] + 'L' dp[i * 2 + 2] = dp[i] + 'R' } m = gets.to_i m.times { puts dp[gets.to_i] }