In the country of AtCoder, there are $N$ stations: station $1$, station $2$, $\ldots$, station $N$.
You are given $M$ pieces of information about trains in the country. The $i$\-th piece of information $(1\leq i\leq M)$ is represented by a tuple of six positive integers $(l _ i,d _ i,k _ i,c _ i,A _ i,B _ i)$, which corresponds to the following information:
* For each $t=l _ i,l _ i+d _ i,l _ i+2d _ i,\ldots,l _ i+(k _ i-1)d _ i$, there is a train as follows:
* The train departs from station $A _ i$ at time $t$ and arrives at station $B _ i$ at time $t+c _ i$.
No trains exist other than those described by this information, and it is impossible to move from one station to another by any means other than by train.
Also, assume that the time required for transfers is negligible.
Let $f(S)$ be the latest time at which one can arrive at station $N$ from station $S$.
More precisely, $f(S)$ is defined as the maximum value of $t$ for which there is a sequence of tuples of four integers $\big((t _ i,c _ i,A _ i,B _ i)\big) _ {i=1,2,\ldots,k}$ that satisfies all of the following conditions:
* $t\leq t _ 1$
* $A _ 1=S,B _ k=N$
* $B _ i=A _ {i+1}$ for all $1\leq i\lt k$,
* For all $1\leq i\leq k$, there is a train that departs from station $A _ i$ at time $t _ i$ and arrives at station $B _ i$ at time $t _ i+c _ i$.
* $t _ i+c _ i\leq t _ {i+1}$ for all $1\leq i\lt k$.
If no such $t$ exists, set $f(S)=-\infty$.
Find $f(1),f(2),\ldots,f(N-1)$.
## Constraints
* $2\leq N\leq2\times10 ^ 5$
* $1\leq M\leq2\times10 ^ 5$
* $1\leq l _ i,d _ i,k _ i,c _ i\leq10 ^ 9\ (1\leq i\leq M)$
* $1\leq A _ i,B _ i\leq N\ (1\leq i\leq M)$
* $A _ i\neq B _ i\ (1\leq i\leq M)$
* All input values are integers.
## Input
The input is given from Standard Input in the following format:
$N$ $M$
$l _ 1$ $d _ 1$ $k _ 1$ $c _ 1$ $A _ 1$ $B _ 1$
$l _ 2$ $d _ 2$ $k _ 2$ $c _ 2$ $A _ 2$ $B _ 2$
$\vdots$
$l _ M$ $d _ M$ $k _ M$ $c _ M$ $A _ M$ $B _ M$
[samples]