#Lutece0459. Killer on the Way
Killer on the Way
Migrated from Lutece 459 Killer on the Way
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Houraisan Kaguya (蓬萊山輝夜) is the NEET (not in education, employment or training) princess living in Eientei (永遠亭). She is an unemployed geek, who sits at home and surfs the Internet all day. But today is different, as the Hakurei Shrine Reitaisai Festival (博麗神社例大祭) will be hosted in Hakurei Shrine, Kaguya decides to go to buy some new doujin games.
Fujiwara no Mokou (藤原妹紅) detests Kaguya, and has been planing to attack her for a long time. But she nerver got the chance before because Kaguya kept staying in Eientei, under the protection of Yagokoro Eirin (八意永琳). Knowing that Kaguya will go outside today, Mokou decides to wait on certain road and attack her once she passes there. Mokou don't know which path Kaguya will choose, but she thinks that there always exits some roads where she can always meet Kaguya.
Input
There are multiple cases. Each case begins with two integers -- the number of villages and -- the number of roads. Then lines, each contains two integers and (), indicating a road connecting village and village . Village is Eientei and Village is Hakurei Shrine. They are always connected by roads. There may be more than one roads between two villages.
Output
Find out the roads where Mokou can always meet Kaguya. For each case, output the number of roads in the first line, then output the numbers of the roads in ascending order in the second line. If the number is ,also output a line without anything.
Samples
3 2
0 1
1 2
7 8
0 1
0 2
1 3
2 3
3 4
3 5
4 6
5 6
2
0 1
0
Resources
ZOJ Monthly, August 2010