Under construction

Still being built. Things may change

A Plus Equals B

Time limit1sMemory limit1024 MB

Summary
Given A and B up to 10^18, output at most 5000 operations of the form A+=A, A+=B, B+=A, or B+=B that make A and B equal.
Level

Medium6 of 10

Topics
Number theory, Math, Greedy
Solved
No attempts yet

Problem

A+BA+B is a problem used to test basic knowledge in competitive programming. Here is yet another boring variation of it.

You have two integers, AA and BB. You want to make them equal. To do so, you can perform several steps, where each step is one of the following:

  • AA += AA
  • AA += BB
  • BB += AA
  • BB += BB

Unfortunately, A+BA+B is a hard problem for us, so you are allowed to make at most 5000 steps.

Input

The first line contains two space-separated integers AA and BB. These are the initial values of the variables AA and BB.

Output

In the first line, print a single integer nn (0≤n≤5 0000 \le n \le 5\,000), the number of steps.

In the next nn lines, print one of the following strings to denote the operation: A+=A, A+=B, B+=A, B+=B.

Any sequence of steps that yields the desired result is judged correct.

Constraints

1≤A, B≤10181 \le A,\ B \le 10^{18}

Examples1

  1. Example 1

    Input
    2 3
    Expected output
    4
    B+=B
    B+=A
    A+=A
    A+=A