In this problem, we are going to deal with a special structure called Boolean 3-array.
A Boolean 3-array of size m × n × p is a three-dimensional array denoted as A, where
(1 ≤ i ≤ m, 1 ≤ j ≤ n, 1 ≤ k ≤ p). We define any one of these as an operation on a Boolean 3-array A of size m × n × p:
We say two Boolean 3-arrays A, B are essentially identical, if and only if any one of them can be transformed to the other, by applying operations finitely many times; otherwise, we say A and B are essentially different.
Now, given the size of the Boolean 3-array, can you determine the maximum number of Boolean 3-arrays of given size you may choose, such that any two of them are essentially different?
The first line of input is a single integer T (1 ≤ T ≤ 300), the number of test cases.
Each test case is a single line of three integers n, m, p (1 ≤ m, n, p ≤ 13), the size of the Boolean 3-array.
For each test case, display an integer in a single line: the answer modulo 998244353.
3
1 1 1
2 2 2
2 3 4
1
9
723
| Name |
|---|


