#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996) #include #include #include #include #include #include using namespace std; #define rep(i,a,b) for(int i=(a);i<(b);i++) string solve() { string str; int A; cin >> A; while(A > 0) { string str2; if(A%2) { str2 = str; str = "L"; str += str2; A = A/2; } else { str2 = str; str = "R"; str += str2; A = A/2 -1; } } return str; } int main() { int M; cin >> M; rep(i,0,M) { string str = solve(); cout << str << endl; } return 0; }