Олимпиадный тренинг

Задача 24726. GOLBEZ IN BERLAND


Задача

Темы:
                                           GOLBEZ IN BERLAND
Tourist Golbez loves to travel. This time he decided to visit Berland.
 Berland is a certain number of cities connected by two-way roads. From any city in Berland you can get to any other. No road connects the city to itself.  
We will call a road a federal road if there exists any pair of cities v and u ( v != u) such that any path from v to u lies through this road. We will call a city a federal city if all roads outgoing  from this city are federal roads.
 Golbez decided to visit all the federal cities of Berland. Help him decide which cities he needs to visit.
Input
The first line contains two numbers: n – number of cities in Berland ( 2 <= n <= 10^5), m – number of roads in Berland ( 1 <= m <= 10^6).
Then there are m lines containing the description of roads, namely: each line contains two numbers: X and Y. This means that city X and city Y are connected by a road.
Imprint
In the first line print the number s  – number of federal cities. In the second line print s numbers  - numbers of federal cities in ascending order.
Example
5 5
1 2
1 3
23
34
4 5
2
4 5