시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 (언어별 추가 시간 없음) 1024 MB 126 23 22 78.571%

문제

$A+B$ is a problem used to test one's basic knowledge for competitive programming. Here is yet another boring variation of it.

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

  • $A$ += $A$
  • $A$ += $B$
  • $B$ += $A$
  • $B$ += $B$

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

입력

In the first line, two space-separated integers $A$ and $B$ are given. These are the initial values of the variables $A$ and $B$.

출력

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

In the next $n$ lines, print one of the following strings to denote your desired operation: A+=AA+=BB+=AB+=B.

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

제한

  • $1 \le A,\ B \le 10^{18}$

서브태스크 1 (36점)

This subtask has an additional constraint: 

  • $A = 1$

서브태스크 2 (64점)

This subtask has no additional constraints.

예제 입력 1

2 3

예제 출력 1

4
B+=B
B+=A
A+=A
A+=A

출처

University > KAIST > 2019 KAIST RUN Spring Open Contest D번

  • 문제를 만든 사람: ainta

채점

  • 예제는 채점하지 않는다.