Dense forest in the Western suburbs helps you break loose.西郊有密林,助君出重围。
A spanning subgraph of is a graph with vertex set
and edge set a subset of
(not necessarily non-empty or different from
).
The first line consists of a single integer, denoting the number of vertices in the graph.
The nextlines describes the graph with an adjacency matrix, more specifically:
Each of thelines consists of
non-negative numbers.
The-th number of the
-th line
is
, if there's no edge between vertex
and
; or the weight of the only edge between them otherwise.
It's guaranteed thatand
for each
, which ensures the graph is an undirected simple graph with all edges positive-weighted. It's also guaranteed that the number of edges
does not exceed
.
Print a single integer in the first line, which is the value modulo.