You are given two strings $$$X$$$ and $$$Y$$$ of length $$$n$$$ each, consisting of characters A and B. The following two kinds of operations can be applied on the string $$$X$$$ any (including $$$0$$$) number of times:
For example, you can convert ABAA to ABBA, and then ABBA to AABA.
First, find whether it is possible to convert $$$X$$$ into $$$Y$$$ using any (including 0) number of allowed operations. If it is so possible, find the minimum number of operations required for the conversion.
Then, you need to process updates of the following types:
After each update, find if it is possible to convert $$$X$$$ into $$$Y$$$. Note that, you only have to check if it is possible to convert $$$X$$$ into $$$Y$$$; you don't have to actually convert it. Also, you don't have to print the minimum number of operations required after updating, in case the conversion is possible.
The first line contains $$$t (1 \le t \le 100)$$$, the number of test cases. Then, the testcases follow:
For each testcase:
21 0AB4 2ABAAAABAY 3X 2
NO YES 2 NO YES
In the first testcase, $$$X=\texttt{A}$$$ and $$$Y=\texttt{B}$$$. Since the conversion is not possible, we print "NO" on the first line. Then, there are no updates to process ($$$Q = 0$$$), so we move to the next testcase
In the second testcase:
| Number of updates | $$$X$$$ | $$$Y$$$ | Possible to convert? | Minimum Number of moves required |
| 0 | ABAA | AABA | YES | 2 |
| 1 | ABAA | AAAA | NO | - |
| 2 | AAAA | AAAA | YES | 0 (not to be printed) |
ABAA $$$\rightarrow$$$ ABBA $$$\rightarrow$$$ AABA
| Name |
|---|


