CAPCITY  Capital City
There are N cities in Flatland connected with M unidirectional roads. The cities are numbered from 1 to N. The Flat Circle of Flatland (FCF) wants to set up a new capital city for his kingdom. For security reasons, the capital must be reachable from all other cities of Flatland. FCF needs the list of all candidate cities. You are the chief programmer at FACM (Flat Association for Computing Machinery) responsible for providing the list to FCF as soon as possible.
Input
The first line of the input file contains two integers։ 1≤N≤100,000 and 1≤M≤200,000. Each of the following M lines contains two integers 1≤A, B≤N denoting a road from A to B.
Output
The output file contains an integer denoting the number of candidate cities followed by the list of candidate cities in increasing order.
Example
Input:
4 4
1 2
3 2
4 3
2 1
Output:
2
1 2
hide comments
scorpion_ajay:
20170704 14:27:16
WA on test case 20, why????? 

scorpion_ajay:
20170704 11:57:50
@karan_batra it can not be a test case when there is no capital city, read the question carefully!! 

satylogin:
20170625 09:58:47
I really don't know what is the problem with spoj... This happened third time. For storing edge, I declared array size as 100001 instead of 200001 and then instead of giving SIGSEV or RE, it gives WA... wasted a lot of time to look for answer and then just changed the lim and got accepted. If anyone knows why this happens please tell me.. Thanks in advance. 

Kushal Saharan:
20170616 11:54:03
Be careful that the indexing for the cities is 1based and NOT 0based. Costed in uncountable WA/RTE and loads of time. 

steady_bunny:
20170615 14:12:33
@noob909


ayush_1997:
20170306 15:17:49
good question!!


karan_batra:
20170106 15:52:51
Weak test cases. No test case when there is no capital city. 

hamjosh1:
20161113 10:51:38
Use fast IO costed me TLE 

vivekkodu:
20160926 21:39:01
It is accepting solution even in case of disconnected graph. 

mvk944:
20160921 20:12:32
guys this can be easily done without graphs...

Added by:  Narek Saribekyan 
Date:  20100620 
Time limit:  0.210s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: NODEJS OBJC PERL6 SQLITE VB.NET 
Resource:  Armenian TST 2010, Round 2 