IOI#10161

IOI

3 seconds
254.735 megabytes
Medium

Find a path that satisfies the following conditions:

  1. The path is a sequence of distinct cities a_1, a_2, \ldots, a_k, where each pair of consecutive cities is connected by a direct road.

  2. The total length of the path is exactly .

Choose such a sequence of cities so that is minimized.

Input

The first line contains two integers and (1 \leq n \leq 2 \cdot 10^5, 1 \leq l \leq 10^6): the number of cities and the required path length.

Each of the following n - 1 lines contains three integers v_i, u_i, and t_i (1 \leq v_i, u_i \leq n, v_i \neq u_i, 1 \leq t_i \leq 10^6), indicating that there is a road of length t_i between cities v_i and u_i.

Output

Print the minimal , or if no such path exists.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Example 3

Loading
Loading

Note

  • In the first example, you can select the sequence of cities .

  • In the second example, it is impossible to find such a path.

  • In the third example, you can select the sequence .