package main import . "fmt" func main() { var n int64 Scan(&n) var s string for n>1 { n-- if n%2==0&&(n/2%2==1||n/2%3==1) { n/=2 s="A"+s } else { n/=3 s="B"+s } } Println(s) }