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 = x - tar; StringBuilder sb = new StringBuilder(); for (; h > 0; h--) { if (tar%2 == 0) { sb.append("R"); } else { sb.append("L"); } tar /= 2; } System.out.println(sb.reverse()); n--; } } }