The first line of input consists of two positive integers n,mn, mn,m (1≤n≤1051 \le n \le 10^51≤n≤105, 1≤m≤1051 \le m \le 10^51≤m≤105), representing the number of houses and the number of villagers respectively.
Then follows nnn lines. The iii-th line consist of two integers xi, yix_i,\ y_ixi, yi (∣xi∣, ∣yi∣≤106|x_i|,\ |y_i| \le 10^6∣xi∣, ∣yi∣≤106), denoting the coordinate of the iii-th house. It is guaranteed that all the coordinates of houses are distinct.
Then follows n−1n-1n−1 lines. The iii-th line consist of two positive integers uiu_iui and viv_ivi (1≤ui,vi≤n, ui≠vi1 \le u_i, v_i \le n,~u_i \ne v_i1≤ui,vi≤n, ui=vi), indicating there is a road connecting the uiu_iui-th house and the viv_ivi-th house. It is guaranteed that the roads meet with the restrictions mentioned above.
Then follows mmm lines. The iii-th line consist of eight integers pisx, qisx, pisy, qisy, piex, qiex, piey, qieyp_i^{sx},\ q_i^{sx},\ p_i^{sy},\ q_i^{sy},\ p_i^{ex},\ q_i^{ex},\ p_i^{ey},\ q_i^{ey}pisx, qisx, pisy, qisy, piex, qiex, piey, qiey (∣pi∗∣≤1012|p_i^*| \le 10^{12}∣pi∗∣≤1012, 0<qi∗≤1060 < q_i^* \le 10^60<qi∗≤106), denoting the route of the iii-th villager -- the starting point is (pisxqisx, pisyqisy)(\frac{p_i^{sx}}{q_i^{sx}},\ \frac{p_i^{sy}}{q_i^{sy}})(qisxpisx, qisypisy), and the ending point is (piexqiex, pieyqiey)(\frac{p_i^{ex}}{q_i^{ex}},\ \frac{p_i^{ey}}{q_i^{ey}})(qiexpiex, qieypiey). It is guaranteed that each pair of numerator and denominator is co-prime, and the starting point and ending point won't coincide