Intersection
The first Chinese emperor of the Mongol Yuan dynasty, Kublai (grandson of Genghis Khan), known to the Mongols as Kagan Secen, waged wars of conquest. Consequently, he was in constant need of funds, which he sought to raise from merchants by imposing tolls. However, savvy merchants often managed to avoid the crossroads where tax collectors were stationed. With too few Mongol conquerors to guard every intersection, tax collectors were strategically positioned to ensure they couldn't be bypassed.
Your task is to identify which crossroads completely divide the road network into disconnected components.
Input Data
All points in the road network, including crossroads and road ends, are sequentially numbered with natural numbers from 1 to a certain natural number n (n ≤ 1234567). Each line in the input contains a pair of natural numbers, representing the endpoints of a road that directly connects them, with no intermediate points. Each road is listed only once. These roads allow travel between any two points. The total number of roads does not exceed 1234567.
Output Data
The output should be a single line listing, in ascending order, the numbers of all points whose removal (along with the roads connected to them) results in the road network being split into at least two disconnected components. In other words, after such a removal, the statement that travel is possible between any two points is no longer true. A merchant cannot bypass the tax collector at such a crossroads when moving between different components of the road network. The input data guarantees the existence of at least one such critical crossroads.