#include <bits/stdc++.h>
using namespace std;

signed main(){
  int M; cin >> M;
  for( int i = 0; i < M; ++i ){
    string ans;
    int A; cin >> A;
    while( A ){
      ans += "RL"[ A & 1 ];
      if( ~A & 1 ) --A;
      A >>= 1;
    }
    reverse( ans.begin(), ans.end() );
    cout << ans << endl;
  }
  return 0;
}