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<sup class="upper-index">18</sup>, *xy* &gt; 1) — the number of oranges and apples that were initially in the bag.
def find_cards(x, y):
    # Create a tuple representing the current state with oranges (x) and apples (y)
    state = (x, y)
    
    # Create a set to keep track of visited states to detect cycles
    visited = set()
    
    # Create an empty list to store the sequence of cards played
    cards = []

    # Loop until the current state is either (0, 0) or a state that has been visited before
    while state not in visited:
        # Mark the current state as visited
        visited.add(state)
        
        # Extract the oranges (a) and apples (b) from the current state
        a, b = state
        
        # Check if one of the fruits is empty, if yes, the game ends
        if a == 0 or b == 0:
            break

        # If there are more oranges than apples, play an 'A' card
        if a >= b:
            cards.append('A')
            # Update the state by giving all apples to Bob
            state = (a - b, b)
        # If there are more apples than oranges, play a 'B' card
        else:
            cards.append('B')
            # Update the state by giving all oranges to Alice
            state = (a, b - a)

    # If the state reached is (0, 0), it means we found a valid sequence of cards
    if state == (0, 0):
        # Join the list of cards into a single string and return it
        return "".join(cards)
    else:
        # If the loop ended without reaching (0, 0), it means no valid sequence exists
        return "Impossible"


# Input
x, y = map(int, input().split())

# Output
result = find_cards(x, y)
print(result)

 	  					    		 		 	 			  	   	