Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years.
×

Package for this problem was not updated by the problem writer or Codeforces administration after we’ve upgraded the judging servers. To adjust the time limit constraint, solution execution time will be multiplied by 2. For example, if your solution works for 400 ms on judging servers, then value 800 ms will be displayed and used to determine the verdict.

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

E. Fairy

time limit per test

1.5 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputOnce upon a time there lived a good fairy A. One day a fine young man B came to her and asked to predict his future. The fairy looked into her magic ball and said that soon the fine young man will meet the most beautiful princess ever and will marry her. Then she drew on a sheet of paper *n* points and joined some of them with segments, each of the segments starts in some point and ends in some other point. Having drawn that picture, she asked the young man to erase one of the segments from the sheet. Then she tries to colour each point red or blue so, that there is no segment having points of the same colour as its ends. If she manages to do so, the prediction will come true. B wants to meet the most beautiful princess, that's why he asks you to help him. Find all the segments that will help him to meet the princess.

Input

The first input line contains two integer numbers: *n* — amount of the drawn points and *m* — amount of the drawn segments (1 ≤ *n* ≤ 10^{4}, 0 ≤ *m* ≤ 10^{4}). The following *m* lines contain the descriptions of the segments. Each description contains two different space-separated integer numbers *v*, *u* (1 ≤ *v* ≤ *n*, 1 ≤ *u* ≤ *n*) — indexes of the points, joined by this segment. No segment is met in the description twice.

Output

In the first line output number *k* — amount of the segments in the answer. In the second line output *k* space-separated numbers — indexes of these segments in ascending order. Each index should be output only once. Segments are numbered from 1 in the input order.

Examples

Input

4 4

1 2

1 3

2 4

3 4

Output

4

1 2 3 4

Input

4 5

1 2

2 3

3 4

4 1

1 3

Output

1

5

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Feb/22/2020 14:04:55 (f2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|