You live in a small town with *R* bidirectional roads connecting *C* crossings and you want to go from crossing 1 to crossing *C* as soon as possible. You can visit other crossings before arriving at crossing C, but it’s not mandatory.

You have exactly one chance to ask your friend to repair exactly one existing road, __from the time you __**leave crossing 1**. If he repairs the

*i*-th road for

*t*units of time, the crossing time after that would be

*v*

_{i}a_{i}^{-t}. It's not difficult to see that it takes

*v*units of time to cross that road if your friend doesn’t repair it.

_{i}

You cannot start to cross the road when your friend is repairing it.

# Input

There will be at most 25 test cases. Each test case begins with two integers *C* and *R* (2<=*C*<=100, 1<=*R*<=500). Each of the next *R* lines contains two integers *x _{i}*,

*y*(1<=

_{i}*x*,

_{i}*y*<=C) and two positive floating-point numbers

_{i}*v*and

_{i}*a*(1<=

_{i}*v*<=20,1<=

_{i}*a*<=5), indicating that there is a bidirectional road connecting crossing

_{i}*x*and

_{i}*y*, with parameters

_{i}*v*and

_{i}*a*(see above). Each pair of crossings can be connected by at most one road. The input is terminated by a test case with

_{i}*C*=

*R*=0, you should not process it.

# Output

For each test case, print the smallest time it takes to reach crossing *C* from crossing 1, rounded to 3 digits after decimal point. It’s always possible to reach crossing *C* from crossing 1.