A trie (prefix tree) is a tree-like data structure in which edges are labeled with characters. From any node, all outgoing edges have distinct labels, and the sequence of labels on the path from the root to a node represents a string.
Take the picture below as an example. The path $$$1\rightarrow4\rightarrow8\rightarrow12$$$ represents the string "caa".
In this problem, the alphabet consists of all positive integers, rather than a fixed set of characters.
There are $$$n$$$ non-empty strings $$$S_1, S_2, \dots, S_n$$$ that form a trie $$$T$$$ with $$$m$$$ nodes. Node $$$1$$$ is the root, while the indices of the remaining nodes have been arbitrarily permuted.
Given the structure of the trie, your task is to reconstruct the original strings.
The lexicographic order of string sequences is defined as follows: $$$[A_1, A_2, \dots, A_n]$$$ is smaller than $$$[B_1, B_2, \dots, B_n]$$$ if there exists an index $$$k$$$ such that $$$A_i = B_i$$$ for all $$$1 \le i \lt k$$$ and $$$A_k \lt B_k$$$.
The lexicographic order of two integer strings is defined as follows: a string $$$C$$$ is lexicographically smaller than a string $$$D$$$ if and only if either $$$C$$$ is a prefix of $$$D$$$, or there exists an index $$$k ~(1 \le k \le \min(|C|, |D|))$$$ such that $$$C(i) = D(i)$$$ for all $$$1 \le i \lt k$$$ and $$$C(k) \lt D(k)$$$, where $$$C(k)$$$ denotes the $$$k$$$-th element of string $$$C$$$.
The first line contains an integer $$$T~ (1 \le T \le 500)$$$, the number of test cases.
For each test case:
The total number of nodes over all test cases does not exceed $$$2,000,000$$$.
For each test case:
Output one integer $$$n$$$, the number of reconstructed strings.
Then output $$$n$$$ lines. The strings themselves may be extremely long, so only their hash values are required.
The $$$i$$$-th line should contain the hash value of string $$$S_i$$$, defined as $$$$$$ \left( \sum_{j=1}^{|S_i|} 998244353^{|S_i|-j} \cdot S_i(j) \right) \bmod 2^{64}. $$$$$$
42131 141 2 161 2 1 4 5
1 1 2 1 2 2 1 1996488707 2 998244354 1992983577591021572
For the example,
| Name |
|---|


