fn main() {
    let mut num = String::new();
    std::io::stdin().read_line(&mut num).ok().expect("ERROR");
    let num: usize = num.trim().parse().ok().expect("ERROR");

    for _ in 0..num {
        let mut n = String::new();
        std::io::stdin().read_line(&mut n).ok().expect("ERROR");
        let mut n: usize = n.trim().parse().ok().expect("ERROR");

        let mut res = String::new();
        while n > 0 {
            if n % 2 == 0 {
                res = format!("{}{}", "R", res);
            }
            else {
                res = format!("{}{}", "L", res);
            }
            n = (n-1) >> 1;
        }
        println!("{}", res);
    }
}