#P1793. 跑步

跑步

Description

New cows arrived at the unit. CG requires them to go for a morning run every day, from Farm AA to Farm BB. Between Farm AA and Farm BB there are n2n-2 intersections, which are numbered: Farm AA is number 11, Farm BB is number nn, and the intersections are numbered 2,3,4,,n12,3,4,\cdots,n-1. There are many routes from Farm AA to Farm BB. CG notices that some intersections are must-pass, meaning every route goes through them. CG wants to record them, so CG can go to such an intersection first to check whether the new cows are slacking. Your task is to find all must-pass intersections.

Input Format

The first line contains two integers n (3n2000)n\ (3 \le n \le 2000) and e (1e8000)e\ (1 \le e \le 8000) separated by a space.

From line 22 to line e+1e+1, each line contains two integers pp and qq separated by a space, indicating that there is a direct path between intersection pp and qq.

The input guarantees that must-pass intersections exist, and every intersection is connected to both Farm AA and Farm BB.

Output Format

The first line contains an integer mm, the number of must-pass intersections.

On the second line, output the indices of all must-pass intersections in increasing order, with a single space between every two numbers.

6 6
1 2
2 4
2 3
3 5
4 5
5 6

2
2 5

Hint

Translated by ChatGPT 5