#include std::string calc(int num) { std::string res; while( num != 0 ) { res.push_back( num == (num - 1) / 2 * 2 + 1 ? 'L' : 'R' ); num = (num - 1) / 2; } std::reverse(res.begin(), res.end()); return res; } int main() { int n; scanf("%d", &n); int a; for(int i = 0; i < n; ++i) { scanf("%d", &a); auto res = calc(a); std::cout << res << std::endl; } return 0; }