{"raw_statement":[{"iden":"problem statement","content":"You are given a sequence $S_1,\\ldots,S_N$ of length-$M$ strings consisting of digits (`0123456789`) and `?`.\nThere are $10^q$ ways to replace the occurrences of `?` with digits independently, where $q$ is the total number of `?` in $S_1,\\ldots,S_N$. Among them, how many satisfy $S_1\\lt S_2 \\lt \\ldots \\lt S_N$ when the resulting strings are seen as integers? Find this count modulo $998244353$.\nThe resulting strings may have leading zeros. For instance, `0000000292` is seen as $292$."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 40$\n*   $1 \\leq M \\leq 40$\n*   $N$ and $M$ are integers.\n*   $S_i$ is a string of length $M$ consisting of digits and `?`."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $M$\n$S_1$\n$\\vdots$\n$S_N$"},{"iden":"sample input 1","content":"3 2\n?0\n??\n05"},{"iden":"sample output 1","content":"4\n\nHere are the four desired replacements.\n\n*   Replace the first character of $S_1$ with `0`, and the first and second characters of $S_2$ with `0` and `1`, respectively.\n*   Replace the first character of $S_1$ with `0`, and the first and second characters of $S_2$ with `0` and `2`, respectively.\n*   Replace the first character of $S_1$ with `0`, and the first and second characters of $S_2$ with `0` and `3`, respectively.\n*   Replace the first character of $S_1$ with `0`, and the first and second characters of $S_2$ with `0` and `4`, respectively."},{"iden":"sample input 2","content":"2 1\n0\n0"},{"iden":"sample output 2","content":"0"},{"iden":"sample input 3","content":"10 10\n1?22??37?4\n1??8?0??49\n3?02??8044\n51?4?8?7??\n5?9?20???2\n68?7?6?800\n?3??2???23\n?442312158\n??2??921?8\n????5?96??"},{"iden":"sample output 3","content":"137811792\n\nFind the count modulo $998244353$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}