Kaleidoscopic Route

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

There are nn cities in Kaleidostan connected with mm bidirectional roads. The cities are numbered from 11 to nn. Each road has an integer called colorfulness

Keanu wants to travel from city 11 to city nn. He wants to take the shortest route --- that is, the route with the smallest number of roads. Among all the shortest routes, he wants to take the kaleidoscopic one --- that is, the route with the largest possible difference between the maximum and the minimum colorfulnesses of its roads. Help Keanu find such a route.

입력

The first line contains two integers nn and mm --- the number of cities and the number of roads (2n1052 \le n \le 10^5; 1m21051 \le m \le 2 \cdot 10^5).

The ii-th of the following mm lines contains three integers v_iv\_i, u_iu\_i, and c_ic\_i --- the indices of the cities connected by the ii-th road, and the colorfulness of the ii-th road (1v_i,u_in1 \le v\_i, u\_i \le n; v_iu_iv\_i \neq u\_i; 0c_i1090\le c\_i \le 10^9).

Each pair of cities is connected by at most one road. It is guaranteed that you can travel from any city to any other city using the roads.

출력

In the first line, print a single integer kk --- the number of roads in the required route. 

In the second line, print k+1k+1 integers c_0,c_1,,c_kc\_0, c\_1, \ldots, c\_k --- the sequence of cities on the route (1c_in1 \le c\_i \le n; c_0=1c\_0 = 1; c_k=nc\_k = n).

힌트

In the example test, the required route consists of 33 roads, and the difference between the maximum and the minimum colorfulnesses of its roads is 82=68-2=6.