The first line contains two integersand
, representing the number of cities and the total number of days.
The nextlines (from
nd to
-th) each contain four integers
, representing a channel between cities
and
. The cost of opening this channel on the
-th day is
.
It is guaranteed that there are no self-loops, but there may be multiple edges between the same pair of vertices.
Outputlines, each containing an integer, representing the minimum cost for each of the days from
to
.