P = Array.new(5000) P[0] = '' 2100.times do |i| P[2 * i + 1] = P[i] + 'L' P[2 * i + 2] = P[i] + 'R' end puts gets.to_i.times.map{ P[gets.to_i] }