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 <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>

using namespace std;
const int INF = 0x3f3f3f3f;
const int MAX = 200000;
struct edge{
    int from,to,num;
    int cap,flow;
    edge(int u= 0,int v=0,int c=0,int f=0):from(u),to(v),cap(c),flow(f){}
};

struct ISAP{
    int head[MAX];
    int next[MAX];
    int tot;
    edge edges[2 * MAX];
    int que[MAX],front,tail;
    int d[MAX];
    bool vis[MAX];
    int num[MAX];
    int pre[MAX];
    int cur[MAX];
    int s,t,n;
    edge cut[2 * MAX];
    int cut_cnt;
    void init(int n){
        this->n = n;
        memset(head,-1,sizeof(head));
        tot = cut_cnt =  0;//
    }
    void addedge(int from,int to, int cap){
        edges[tot] = edge{from,to,cap,0};//注意无向?和有向?
        next[tot] = head[from], head[from] = tot++;
        edges[tot] = edge{to,from,cap,0};
        next[tot] = head[to],head[to] = tot++;
    }
    void bfs(){
        memset(vis,0,sizeof(vis));
        front = tail = 0;
        d[t] = 0;
        vis[t] = true;
        que[tail++] = t;
        while(front < tail){
            int u = que[front++];
            for(int v = head[u]; v != -1; v = next[v]){
                edge & e = edges[v^1];
                if(e.cap > e.flow && !vis[e.from]){
                    d[e.from] = d[u] + 1;
                    vis[e.from] = true;
                    que[tail++] = e.from;
                }
            }
        }
    }
    int Augment(){
        int x = t,a = INF;
        while(x != s){
            edge& e = edges[pre[x]];
            a = min(a,e.cap - e.flow);
            x = e.from;
        }

        x = t;
        while(x != s){
            edges[pre[x]].flow += a;
            edges[pre[x]^1].flow -= a;
            x = edges[pre[x]].from;
        }
        return a;
    }
    int maxflow(int s, int t){
        this->s = s, this->t = t;
        memset(num,0,sizeof(num));
        int flow = 0;
        bfs();
        for(int i = 1; i <= n; ++i){
            num[d[i]]++,cur[i] = head[i];
        }
        int x = s;
        while(d[s] < n){
            if(x == t){
                flow += Augment();
                x = s;
            }
            bool ok = false;
            for(int &v = cur[x]; v != -1; v = next[v]){
                edge& e = edges[v];
                if(e.cap > e.flow && d[x] == d[e.to] + 1){
                    ok = true;
                    pre[x = e.to] = v;
                    break;
                }
            }
            if(!ok){
                int m = n - 1;
                for(int v = head[x]; v != -1; v = next[v]){
                    edge & e = edges[v];
                    if(e.cap > e.flow) m = min(m,d[e.to]);
                }
                if(--num[d[x]] == 0) break;
                num[d[x]=m+1]++;
                cur[x] = head[x];
                if(x != s) x = edges[pre[x]].from;
            }
        }
        return flow;
    }
    void mincut(){
        bfs();
        for(int i = 0 ;i < tot; ++i){
            edge & e = edges[i];
            if(!vis[e.from] && vis[e.to] && e.cap > 0)
                cut[cut_cnt++] = e;
        }
    }
    void print(){
        printf("Graph:\n");
        for(int i = 0 ; i < tot; ++i){
            edge & e = edges[i];
            printf("%d->%d c:%d f:%d\n",e.from,e.to,e.cap,e.flow);
        }
    }
    void solve(int s, int t){
        printf("%d\n",maxflow(s,t));
        vector<int> ans;
        for(int i = 0; i < tot; i += 2){
            edge & e = edges[i];
            if(e.flow < 0 )
                ans.push_back(i / 2 + 1);
        }
        printf("%d\n",ans.size());
        for(int i = 0, sz = ans.size(); i < sz; ++ i)
            printf("%d\n",ans[i]);
    }
}solve;


int main(void)
{
    //freopen("input.txt","r",stdin);
    int N,M;
    int u,v;
    int s,t;
    scanf("%d %d", &N,&M);
    solve.init(N);
    for(int i = 0; i < M; ++i){
        scanf("%d %d", &u,&v);
        solve.addedge(u,v,1);
    }
    scanf("%d %d", &s,&t);
    solve.solve(s,t);
    return 0;
}