Races#816

Races

1 second
64 megabytes
Hard

On a certain railway line, there are stations numbered consecutively from to . The distances between some pairs of these stations are known. Your task is to determine the lengths of all segments between neighboring stations or to indicate if it is impossible (i.e., the given information is contradictory or insufficient).

Input

The input begins with two numbers: — the number of stations (2 \leq N \leq 100), and — the number of station pairs for which distances are provided (0 \leq E \leq 10000). Then triplets of numbers follow. Each triplet consists of two station numbers (ranging from to ) and the distance between them. All distances are precise, non-negative real numbers with at most digits after the decimal point.

Output

If the segment lengths can be uniquely determined, output the number followed by N-1 real numbers. The first number should represent the distance from station to station , the second from station to station , and so on. All numbers must be printed with exactly digits after the decimal point.

If the information is contradictory or insufficient to uniquely determine the segment lengths, output the number .

Examples

Example 1

Loading
Loading