Just before the 2022 Shanghai Collegiate Programming Contest, you decide to play some games to chill out. Today, your friend Tommy introduces a game called Nerdle to you. This game is about to guess some equations.
A game in Nerdle. You can present an equation to the jury each time. The jury will send back results by the colors:
After playing for a while, you found that you spent a lot of time just trying to make the left-hand side equal to the right-hand side. As a strong competitive programmer, it's so much a waste of time for you. You decide to use your computer to analyze the result of one equation so that the remaining possible equation can be obtained. The equation and answer have the following restrictions:
Write a program to find out all possible remaining equations by a given result.
The input contains two strings $$$E, C$$$ of length $$$8$$$ in two lines, denoting the equation asked and the color returned by the jury, respectively. $$$C$$$ consists of 'GPB', denoting green, purple, and black of the corresponding spot.
It's guaranteed that:
Print an integer $$$R$$$ in the first line, denoting the number of different remaining possible equations. Two equations are considered different if they are different on at least one character.
For the next $$$R$$$ lines, print a string in each line denoting a valid equation corresponding to the input.
You can print your solution in any order. It's guaranteed that at least one valid equation exists.
40+11=51 PBGPPGGB
7 11+42=53 11+43=54 11+44=55 11+45=56 11+46=57 11+47=58 11+48=59
12+46=58 GBGGPGGB
6 11+45=56 13+43=56 15+41=56 16+40=56 16+41=57 16+43=59
11+22=33 PBGPPGGP
1 22+13=35
11+22=33 BPGPPGGP
1 22+13=35
01+02=03 PPGPPGPP
2 10+20=30 20+10=30
From the first and the second example, one can conclude that the only solution for the game in the figure is 11+45=56.
The third and the fourth sample are the same, yet the black and purple tiles are chosen differently.
| Name |
|---|


