404239: GYM101466 D Double it

Memory Limit:64 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Double ittime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard output

Alex has two magic machines A and B. Machine A will give you 2x + 1 coins if you insert x coins in it, machine B will give you 2x + 2. Alex has no coins and wants to get exactly n coins in order to buy a new unicorn, but he can't figure out how to do it. Your task is to find a way to use the machines to get exactly n coins.

Input

The input consists of a single line containing n (1 ≤ n ≤ 109).

Output

For each one output a string of A's and B's giving the order in which the machines are used.

ExamplesInput
7
Output
AAA
Input
10
Output
ABB

加入题单

上一题 下一题 算法标签: