题目描述

Dense forest in the Western suburbs helps you break loose.

西郊有密林,助君出重围。

Given a weighted undirected simple graph with $n$ vertices and $m$ positive-weighted edges. Sum up the weight of the minimum spanning forest for each of its spanning subgraph, and print the value modulo $998244353$ as answer.

A minimum spanning forest of a weighted undirected graph $G$ with vertex set $V$ and edge set $E$ is defined as follows:

  • It's a subset of $E$ (not necessarily non-empty or different from $E$), denoted as $S$.

  • Any pair of vertices $(u, v)$ which can reach each other in $G$ can still reach each other only using edges in $S$.

  • $S$ is the subset with minumum weight among all subsets satisfying the above two conditions. The weight of $S$ is the sum of weight of all edges in it.

    A spanning subgraph of $G$ is a graph with vertex set $V$ and edge set a subset of $E$ (not necessarily non-empty or different from $E$).


输入格式

The first line consists of a single integer $n (n \leq 16)$, denoting the number of vertices in the graph.

The next $n$ lines describes the graph with an adjacency matrix, more specifically:

Each of the $n$ lines consists of $n$ non-negative numbers.
The $j$-th number of the $i$-th line $A_{i, j} (0 \leq A_{i, j} \leq 10^9)$ is $0$, if there's no edge between vertex $i$ and $j$; or the weight of the only edge between them otherwise.

It's guaranteed that $A_{i, i} = 0$ and $A_{i, j} = A_{j, i}$ for each $1 \leq i, j \leq n$, which ensures the graph is an undirected simple graph with all edges positive-weighted. It's also guaranteed that the number of edges $m$ does not exceed $100$.


输出格式

Print a single integer in the first line, which is the value modulo $998244353$.


样例数据

输入

4
0 1 1 1
1 0 1 1
1 1 0 1
1 1 1 0

输出

158

备注


操作

评测记录

优秀代码

信息

时间限制: 5s
内存限制: 512MB
评测模式: Normal

题解