{"raw_statement":[{"iden":"problem statement","content":"You have a simple undirected graph. Each vertex in this graph has an integer interval written on it, and there are $C_{i,j}$ vertices with the interval $[i,j]$ ($1 \\leq i \\leq j \\leq N$). There are no vertices with other intervals.\nFor any two vertices, there is an undirected edge between them if and only if the written intervals intersect. Here, an interval $[a,b]$ and an interval $[c,d]$ intersect if and only if $\\max(a,c) \\leq \\min(b,d)$.\nFind the number of spanning trees of this graph, modulo $998244353$. Here, all vertices are pairwise distinguishable."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 400$\n*   $1 \\leq C_{i,j} \\leq 10^4$\n*   All numbers in the input are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$C_{1,1}$ $C_{1,2}$ $\\cdots$ $C_{1,N}$\n$C_{2,2}$ $\\cdots$ $C_{2,N}$\n$\\vdots$\n$C_{N,N}$"},{"iden":"sample input 1","content":"2\n1 2\n1"},{"iden":"sample output 1","content":"8"},{"iden":"sample input 2","content":"3\n1 1 1\n1 1\n1"},{"iden":"sample output 2","content":"99"},{"iden":"sample input 3","content":"4\n8 3 8 10\n1 5 3\n1 6\n4"},{"iden":"sample output 3","content":"971555314"},{"iden":"sample input 4","content":"10\n2742 5611 1401 5439 5220 8571 4998 4194 7443 2492\n2393 3201 9106 1649 2456 1984 7159 9679 7695\n808 4600 2573 7771 5839 9504 4381 3223\n5325 2564 456 5050 6963 913 9072\n310 1521 9816 6205 2988 3614\n4810 2979 2852 9242 6290\n7551 7139 7228 699\n4869 889 7597\n4239 5970\n865"},{"iden":"sample output 4","content":"234850531"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}