Given a deterministic finite automaton (DFA) with a state set $$$Q=\{1,2,\dots,n\}$$$, a start state $$$q=1$$$, an accept state set $$$F$$$ of size $$$m$$$, and an alphabet $$$\Sigma=\{\texttt{A},\texttt{C}\}$$$. Find the lexicographically smallest string accepted by the automaton with a length of at least $$$k$$$. Since the answer might be very long, if the length of the answer exceeds $$$n$$$, you only need to output the last $$$n$$$ characters of the answer. If no string satisfies the aforementioned requirements, output WA.
A string is accepted by the automaton if and only if there exists a walk starting from the initial state and ending at an accept state, such that the letters on the traversed transition edges exactly form the string. The walk can pass through repeated vertices and edges.
There are multiple test cases.
The first line contains a single integer $$$T$$$ $$$(1\le T\le 5\times 10^5)$$$, denoting the number of test cases.
For each test case:
It is guaranteed that $$$\sum n\le 10^6$$$.
Output $$$T$$$ lines, each containing a string, where the $$$i$$$-th line represents the answer for the $$$i$$$-th test case.
25 1 642 55 34 25 55 53 1 222 33 33 3
CCCCAWA
In the first test case of the sample, the language recognized by the DFA is $$$\{\texttt{A}\texttt{C}^{2t+1}\texttt{A}\mid t\ge 0\}$$$.