use std::cmp::max; use std::io; use std::io::{Write, BufRead}; fn solve(n:u64) -> Option{ if n == 1{return Some(String::new());} let n = n-1; if n %2 ==0 { if let Some(mut s) = solve(n/2){ s.push('A'); return Some(s); } } if n %3 ==0 { if let Some(mut s) = solve(n/3){ s.push('B'); return Some(s); } } None } pub fn main(){ let test_cases:u32; let stdin = io::stdin(); let mut INPUT = io::BufReader::new(stdin.lock()).lines().map(Result::unwrap); let mut OUTPUT = io::BufWriter::new(io::stdout().lock()); // test_cases = INPUT.next().unwrap().parse().unwrap(); let n = INPUT.next().unwrap().parse::().unwrap(); writeln!(OUTPUT, "{}", solve(n).unwrap()); // for _ in 0..test_cases{ // } }