#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

void solve(string& s, int a) {
  if (a % 2 == 0) {
    s += 'R';
  } else {
    s += 'L';
  }
  a = (a - 1) / 2;
  if(a == 0) return;
  solve(s, a);
}

int main () {

	ios::sync_with_stdio(false);
	cin.tie(0);

  int m, a;
  cin >> m;

  for (int i = 0; i < m; i++) {

    cin >> a;

    string s = "";
    solve(s, a);
  
    reverse(s.begin(), s.end());

    cout << s << "\n";
  }

  return 0;
}