You are given an undirected graph, consisting of n vertices and m edges. The graph does not necessarily connected. Guaranteed, that the graph does not contain multiple edges (more than one edges between a pair of vertices) or loops (edges from a vertex to itself).

A cycle in a graph is called a simple, if it contains each own vertex exactly once. So simple cycle doesn't allow to visit a vertex more than once in a cycle.

Determine the edges, which belong to exactly on one simple cycle.

Input

The first line contain two integers n and m (1 ≤ n ≤ 100 000, 0 ≤ m ≤ min(n ⋅ (n - 1) / 2, 100 000)) — the number of vertices and the number of edges.

Each of the following m lines contain two integers u and v (1 ≤ u, v ≤ n, u ≠ v) — the description of the edges.

Output

In the first line print the number of edges, which belong to exactly one simple cycle.

In the second line print the indices of edges, which belong to exactly one simple cycle, in increasing order. The edges are numbered from one in the same order as they are given in the input.

Examples

Input

3 3
1 2
2 3
3 1


Output

3
1 2 3 


Input

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


Output

6
1 2 3 5 6 7 


Input

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


Output

0
#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
struct edge {
  int to, next;
} e[N << 1];
int h[N], xb, dfn[N], low[N], n, m, i, j, x, y, w, stx[N], sty[N], ste[N];
vector<int> ans;
bool b[N], cant[N];
inline void addedge(int x, int y) {
  e[++xb] = (edge){y, h[x]};
  h[x] = xb;
  e[++xb] = (edge){x, h[y]};
  h[y] = xb;
}
void dfs(int x, int fa) {
  dfn[x] = low[x] = ++xb;
  int i = h[x], j;
  for (; i; i = e[i].next)
    if (e[i].to != fa) {
      if (!dfn[e[i].to]) {
        stx[++w] = x, sty[w] = e[i].to;
        ste[w] = i;
        dfs(e[i].to, x);
        if (low[e[i].to] < low[x]) low[x] = low[e[i].to];
        if (low[e[i].to] >= dfn[x]) {
          int cnt = 0, ow = w;
          for (; stx[w] != x || sty[w] != e[i].to; --w) {
            if (!b[stx[w]]) ++cnt, b[stx[w]] = 1;
            if (!b[sty[w]]) ++cnt, b[sty[w]] = 1;
          }
          if (!b[stx[w]]) ++cnt, b[stx[w]] = 1;
          if (!b[sty[w]]) ++cnt, b[sty[w]] = 1;
          if (ow - w + 1 > cnt || cnt == 2) {
            for (j = w; j <= ow; ++j) cant[ste[j] >> 1] = 1;
          }
          for (j = w; j <= ow; ++j) b[stx[j]] = b[sty[j]] = 0;
          --w;
        }
      } else {
        if (dfn[e[i].to] < dfn[x]) stx[++w] = x, sty[w] = e[i].to, ste[w] = i;
        if (dfn[e[i].to] < low[x]) low[x] = dfn[e[i].to];
      }
    }
}
int main() {
  cin >> n >> m;
  xb = 1;
  for (i = 1; i <= m; ++i) {
    cin >> x >> y;
    addedge(x, y);
  }
  xb = 0;
  for (i = 1; i <= n; ++i)
    if (!dfn[i]) dfs(i, 0);
  for (i = 1; i <= m; ++i)
    if (!cant[i]) ans.push_back(i);
  cout << ans.size() << '\n';
  for (i = 0; i < int(ans.size()); ++i) cout << ans[i] << ' ';
  return 0;
}
