Busiest railway segment (large)

Given a tree and Q paths, count how many paths use each edge and report the edge with the maximum count, breaking ties by lexicographic order of endpoints.

Medium7TreeDFSPrefix sumImplementationNo attempts yetTime limit2sMemory limit512 MB

Problem

The city state CINERIS has NN railway stations. The N1N-1 tracks that join the stations form a tree, so exactly one route connects any two different stations.

Jeongmin, who governs the country, wants to know which segment the most people passed through. QQ tickets have been sold so far, and a single ticket reveals only its departure station and its arrival station.

Every resident of CINERIS travels along a shortest route. In a tree the route between two stations is unique, so one ticket passes through each segment of that route exactly once. Use the QQ tickets to find the segment that the most people passed through.

Input

The first line contains NN and QQ.

Each of the next N1N-1 lines contains two integers aa and bb, meaning a two way track joins station aa and station bb.

Each of the following QQ lines contains the departure station cc and the arrival station dd of one ticket. The person who bought that ticket left station cc and arrived at station dd.

1N2222221 \le N \le 222222, 1Q2222221 \le Q \le 222222

The tracks form a tree, so every station is connected to every other one. An input with no track at all, that is N=1N = 1, is never given. The departure station and the arrival station of a ticket are different.

Output

Print on one line the segment that the most people passed through and how many people passed through it. Print three integers aa, bb, cc separated by spaces, meaning that cc people passed through the segment joining station aa and station bb. Write the two station numbers in increasing order, so that a<ba < b.

If several segments are tied for the most people, print the one whose pair (a,b)(a, b) is smallest in lexicographic order. That is, take the segment with the smaller aa, and among equal aa take the one with the smaller bb.