Problem: ICP city has an express company whose trucks run from the crossing S to the crossing T. The president of the company is feeling upset because all the roads in the city are one-way, and are severely congested. So, he planned to improve the maximum flow (edge disjoint paths) from the crossing S to the crossing T by reversing the traffic direction on some of the roads.

Your task is writing a program to calculate the maximized flow from S to T by reversing some roads, and the list of the reversed roads.



Input

The first line of a data set contains two integers N (2 \leq N \leq 300) and M (0 \leq M \leq {\rm min} (1\,000,\ N(N-1)/2)). N is the number of crossings in the city and M is the number of roads.

The following M lines describe one-way roads in the city. The i-th line (1-based) contains two integers X_i and Y_i (1 \leq X_i, Y_i \leq N, X_i \neq Y_i). X_i is the ID number (1-based) of the starting point of the i-th road and Y_i is that of the terminal point. The last line contains two integers S and T (1 \leq S, T \leq N, S \neq T, 1-based).

The capacity of each road is 1. You can assume that i \neq j implies either X_i \neq X_j or Y_i \neq Y_j, and either X_i \neq Y_j or X_j \neq Y_i.

Output

In the first line, print the maximized flow by reversing some roads. In the second line, print the number R of the reversed roads. In each of the following R lines, print the ID number (1-based) of a reversed road. You may not print the same ID number more than once.

If there are multiple answers which would give us the same flow capacity, you can print any of them.

Examples

Input

2 1
2 1
2 1


Output

1
0


Input

2 1
1 2
2 1


Output

1
1
1


Input

3 3
3 2
1 2
3 1
1 3


Output

2
2
1
3

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define pb            push_back
#define mp            make_pair
template<class T, class S> inline bool minup(T& m, const S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, const S x){ return m<(T)x ? (m=(T)x, true) : false; }

static const int    INF = 1000000000;
static const ll     MOD = 1000000007LL;
static const double EPS = 1E-10;

template<typename T> struct edge
{
  int to;
  T cap;
  int reverse;
  int id;
  edge(int to, T cap, int reverse, int id) : to(to), cap(cap), reverse(reverse), id(id) {}
};

template <typename T> class Dinic
{
private:
  static const T INF = (T)1000000000;
  vector<edge<T> >* G;
  int N;
  int* level;
  int* iter;

  void bfs(int s);
  T dfs(int v, int t, T f);

public:
  Dinic(int N) : N(N) { this->init(); }
  void init();
  void addEdge(int from, int to, T cap, int id);
  T MaximumFlow(int s, int t);
  pair<T, vector<int> > solve(int s, int t);
};

template<typename T> void Dinic<T>::init()
{
  G = new vector<edge<T> >[N];
  level = new int[N];
  iter = new int[N];
  rep(i, N) G[i].clear();
}

template<typename T> void Dinic<T>::addEdge(int from, int to, T cap, int id)
{
  G[from].pb(edge<T>(to, cap, G[to].size(), id));
  G[to].pb(edge<T>(from, cap, G[from].size()-1, -id));
}

template<typename T> void Dinic<T>::bfs(int s)
{
  rep(i, N) level[i] = -1;
  queue<int> que;
  level[s] = 0;
  que.push(s);
  while(!que.empty()){
    int v = que.front();  que.pop();
    vrep(w, G[v]){
      edge<T>& e = *w;
      if(e.cap > (T)0 && level[e.to] < 0){
        level[e.to] = level[v] + 1;
        que.push(e.to);
      }
    }
  }
}

template<typename T> T Dinic<T>::dfs(int v, int t, T f)
{
  if(v == t) return f;
  for(int& i = iter[v]; i<G[v].size(); i++){
    edge<T>& e = G[v][i];
    if(e.cap > (T)0 && level[v] < level[e.to]){
      T d = dfs(e.to, t, min(f, e.cap));
      if(d > (T)0){
        e.cap -= d;
        G[e.to][e.reverse].cap += d;
        return d;
      }
    }
  }
  return 0;
}

template<typename T> T Dinic<T>::MaximumFlow(int s, int t)
{
  T flow = (T)0;
  while(true){
    bfs(s);
    if(level[t] < (T)0) return flow;
    rep(i, N) iter[i] = 0;
    T f;
    while((f = dfs(s, t, Dinic::INF)) > (T)0){
      flow += f;
    }
  }
}

template<typename T> pair<T, vector<int> > Dinic<T>::solve(int s, int t)
{
  T mx = this->MaximumFlow(s, t);
  vi ret;
  rep(i, N) vrep(v, G[i]) if(v->cap == 0 && v->id < 0) ret.pb(-v->id);
  sort(ALL(ret));
  return mp(mx, ret);
}

int N, M;
int S, T;
int x, y;
int mx;

int main(int argc, char *argv[])
{
  cin >> N >> M;
  Dinic<int> dinic(N);

  rep(i, M){
    cin >> x >> y;
    dinic.addEdge(x - 1, y - 1, 1, i + 1);
  }
  cin >> S >> T;
  
  pair<int, vi> res = dinic.solve(S - 1, T - 1);
  cout << res.first << endl;
  cout << res.second.size() << endl;
  vrep(v, res.second) cout << *v << endl;
  
  return 0;
}