The first line contains two integers, nnn and mmm (2≤n≤104,1≤m≤104)(2 \leq n \leq 10^4, 1 \leq m \leq 10^4)(2≤n≤104,1≤m≤104).
The next n−1n-1n−1 lines contain three integers each, uiu_iui, viv_ivi, and cic_ici (1≤ui,vi≤n,ui≠vi,1≤ci≤105)(1 \leq u_i, v_i \leq n, u_i \neq v_i, 1 \leq c_i \leq 10^5)(1≤ui,vi≤n,ui=vi,1≤ci≤105), representing a railway.
The next mmm lines contain four integers each, aia_iai, bib_ibi, xix_ixi, and yiy_iyi (1≤ai,bi≤n,ai≠bi,1≤xi,yi≤105)(1 \leq a_i, b_i \leq n, a_i \neq b_i, 1 \leq x_i, y_i \leq 10^5)(1≤ai,bi≤n,ai=bi,1≤xi,yi≤105), representing a transport line operated by the company.
It is guaranteed that any two stations can be reached from each other through the railway network.