import java.io.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); while (n > 0) { int tar = Integer.parseInt(br.readLine()); int x = 0; int h = 0; int w = 1; while (x < tar) { h++; w *= 2; x += w; } tar = tar + w - x; StringBuilder sb = new StringBuilder(); for (int i = 0; i < h; i++) { w /= 2; if (tar > w) { sb.append("R"); tar -= w; } else { sb.append("L"); } } System.out.println(sb); n--; } } }