Alice, Bob, Oranges and Apples

题意翻译

一开始果篮里有 $x$ 个橘子,$y$ 个苹果。游戏开始前,Alice 从果篮中拿 $1$ 个橘子,Bob 则拿 $1$ 个苹果。 对于一个由字符 `A` 和 `B` 组成的序列,每个字符代表一次操作。`A` 操作表示 Alice 从果篮里拿与自己手里等量的水果送给 Bob(两种分别相等),`B` 操作则相反。 请构造一个字符串序列表示操作,使果篮在从左到右依次执行完所有操作后恰好被拿空。 $x,y\le 10^{18}$。

题目描述

Alice and Bob decided to eat some fruit. In the kitchen they found a large bag of oranges and apples. Alice immediately took an orange for herself, Bob took an apple. To make the process of sharing the remaining fruit more fun, the friends decided to play a game. They put multiple cards and on each one they wrote a letter, either 'A', or the letter 'B'. Then they began to remove the cards one by one from left to right, every time they removed a card with the letter 'A', Alice gave Bob all the fruits she had at that moment and took out of the bag as many apples and as many oranges as she had before. Thus the number of oranges and apples Alice had, did not change. If the card had written letter 'B', then Bob did the same, that is, he gave Alice all the fruit that he had, and took from the bag the same set of fruit. After the last card way removed, all the fruit in the bag were over. You know how many oranges and apples was in the bag at first. Your task is to find any sequence of cards that Alice and Bob could have played with.

输入输出格式

输入格式


The first line of the input contains two integers, $ x,y $ ( $ 1<=x,y<=10^{18},xy&gt;1 $ ) — the number of oranges and apples that were initially in the bag.

输出格式


Print any sequence of cards that would meet the problem conditions as a compressed string of characters 'A' and 'B. That means that you need to replace the segments of identical consecutive characters by the number of repetitions of the characters and the actual character. For example, string AAABAABBB should be replaced by string 3A1B2A3B, but cannot be replaced by 2A1A1B2A3B or by 3AB2A3B. See the samples for clarifications of the output format. The string that you print should consist of at most $ 10^{6} $ characters. It is guaranteed that if the answer exists, its compressed representation exists, consisting of at most $ 10^{6} $ characters. If there are several possible answers, you are allowed to print any of them. If the sequence of cards that meet the problem statement does not not exist, print a single word Impossible.

输入输出样例

输入样例 #1

1 4

输出样例 #1

3B

输入样例 #2

2 2

输出样例 #2

Impossible

输入样例 #3

3 2

输出样例 #3

1A1B

说明

In the first sample, if the row contained three cards with letter 'B', then Bob should give one apple to Alice three times. So, in the end of the game Alice has one orange and three apples, and Bob has one apple, in total it is one orange and four apples. In second sample, there is no answer since one card is not enough for game to finish, and two cards will produce at least three apples or three oranges. In the third sample, cards contain letters 'AB', so after removing the first card Bob has one orange and one apple, and after removal of second card Alice has two oranges and one apple. So, in total it is three oranges and two apples.