Although Nayra doesn't like stories of random arrays as a birthday present. But on her last birthday, she got one such array as a birthday present. After struggling for a day to figure out what to do with this array. She asked Aryan for help. He gave him this problem.
Formally, you are given an array A of N numbers. Let S be the set of XOR of all possible subsets of A.
Find count of distinct numbers in S which have an odd number of bits on. Similarly, find the count of distinct numbers in S which have an even number of bits on.
Since this count can be a very large report it modulo 998244353.
Subtasks
Input format
Output format
Constraints
1≤N≤1000
1≤T≤20
All elements of the array will be given in the binary form.
Note
A bitwise XOR (⊕ operator) takes two-bit integers of equal length and performs the logical xor operation on each pair of corresponding bits. The result in each position is 1 if only the first bit is 1 or only the second bit is 1 but will be 0 if both are 0 or both are 1. You can read more about bitwise XOR operation here.
XOR of a subset B = {B_1, B_2, ...., B_k} is B_1 ⊕ B_2 ⊕ ... ⊕ B_k.
In the first testcase,
A = {0} and hence S = {0}.
In the second testcase,
A = {1} and hence S = {0,1}.
Here, 0 corresponds to an empty subset of A.
In the third testcase,
A = {2,3,4,6,6,5} and hence S = {0,1,2,3,4,5,6,7}.
0,3,5,6 has an even number of bits on, whereas, 1,2,4,7 has an odd number of bits on.
Here, {2,3} has XOR 1 and {4,3,6,6} has XOR 7.