{"raw_statement":[{"iden":"problem statement","content":"There are $N$ non-negative integers written on a blackboard. The $i$\\-th integer is $A_i$.\nTakahashi can perform the following two kinds of operations any number of times in any order:\n\n*   Select one integer written on the board (let this integer be $X$). Write $2X$ on the board, without erasing the selected integer.\n*   Select two integers, possibly the same, written on the board (let these integers be $X$ and $Y$). Write $X$ XOR $Y$ (XOR stands for bitwise xor) on the blackboard, without erasing the selected integers.\n\nHow many different integers not exceeding $X$ can be written on the blackboard? We will also count the integers that are initially written on the board. Since the answer can be extremely large, find the count modulo $998244353$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 6$\n*   $1 \\leq X < 2^{4000}$\n*   $1 \\leq A_i < 2^{4000}(1\\leq i\\leq N)$\n*   All input values are integers.\n*   $X$ and $A_i(1\\leq i\\leq N)$ are given in binary notation, with the most significant digit in each of them being $1$."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $X$\n$A_1$\n$:$\n$A_N$"},{"iden":"sample input 1","content":"3 111\n1111\n10111\n10010"},{"iden":"sample output 1","content":"4\n\nInitially, $15$, $23$ and $18$ are written on the blackboard. Among the integers not exceeding $7$, four integers, $0$, $3$, $5$ and $6$, can be written. For example, $6$ can be written as follows:\n\n*   Double $15$ to write $30$.\n*   Take XOR of $30$ and $18$ to write $12$.\n*   Double $12$ to write $24$.\n*   Take XOR of $30$ and $24$ to write $6$."},{"iden":"sample input 2","content":"4 100100\n1011\n1110\n110101\n1010110"},{"iden":"sample output 2","content":"37"},{"iden":"sample input 3","content":"4 111001100101001\n10111110\n1001000110\n100000101\n11110000011"},{"iden":"sample output 3","content":"1843"},{"iden":"sample input 4","content":"1 111111111111111111111111111111111111111111111111111111111111111\n1"},{"iden":"sample output 4","content":"466025955\n\nBe sure to find the count modulo $998244353$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}