#define  _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#pragma comment (linker, "/STACK:526000000")

#include "bits/stdc++.h"

using namespace std;
typedef string::const_iterator State;
#define eps 1e-10L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL
#define seg_size 262144LL
#define MOD 998244353LL
#define pb push_back
#define mp make_pair
typedef long long ll;
#define REP(a,b) for(long long (a) = 0;(a) < (b);++(a))
#define ALL(x) (x).begin(),(x).end()

typedef complex<long double> Point;
typedef pair<complex<long double>, complex<long double>> Line;

typedef struct Circle {
    complex<long double> center;
    long double r;
}Circle;

long double dot(Point a, Point b) {
    return (a.real() * b.real() + a.imag() * b.imag());
}
long double cross(Point a, Point b) {
    return (a.real() * b.imag() - a.imag() * b.real());
}

long double Dist_Line_Point(Line a, Point b) {
    if (dot(a.second - a.first, b - a.first) < eps) return abs(b - a.first);
    if (dot(a.first - a.second, b - a.second) < eps) return abs(b - a.second);
    return abs(cross(a.second - a.first, b - a.first)) / abs(a.second - a.first);
}

int is_intersected_ls(Line a, Line b) {
    return (cross(a.second - a.first, b.first - a.first) * cross(a.second - a.first, b.second - a.first) < 0) &&
        (cross(b.second - b.first, a.first - b.first) * cross(b.second - b.first, a.second - b.first) < 0);
}

Point intersection_l(Line a, Line b) {
    Point da = a.second - a.first;
    Point db = b.second - b.first;
    return a.first + da * cross(db, b.first - a.first) / cross(db, da);
}

long double Dist_Line_Line(Line a, Line b) {
    if (is_intersected_ls(a, b) == 1) {
        return 0;
    }
    return min({ Dist_Line_Point(a,b.first), Dist_Line_Point(a,b.second),Dist_Line_Point(b,a.first),Dist_Line_Point(b,a.second) });
}

pair<Point, Point> intersection_Circle_Circle(Circle a, Circle b) {
    long double dist = abs(a.center - b.center);
    assert(dist <= eps + a.r + b.r);
    assert(dist+eps >= abs(a.r - b.r));
    Point target = b.center - a.center;
    long double pointer = target.real() * target.real() + target.imag() * target.imag();
    long double aa = pointer + a.r * a.r - b.r * b.r;
    aa /= 2.0L;
    Point l{ (aa * target.real() + target.imag() * sqrt(pointer * a.r * a.r - aa * aa))/pointer,
            (aa* target.imag() - target.real() * sqrt(pointer * a.r * a.r - aa * aa)) / pointer};
    Point r{ (aa * target.real() - target.imag() * sqrt(pointer * a.r * a.r - aa * aa)) / pointer,
        (aa * target.imag() + target.real() * sqrt(pointer * a.r * a.r - aa * aa)) / pointer };
    r = r + a.center;
    l = l + a.center;
    return mp(l, r);
}
void init() {
    iostream::sync_with_stdio(false);
    cout << fixed << setprecision(20);
}

unsigned long xor128() {
    static unsigned long x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    unsigned long t = (x ^ (x << 11));
    x = y; y = z; z = w;
    return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}

#define int ll
int dist[400][400];
vector<int> vertexs[400];
int s, t;
int n, m;
int visited[400];
int dfs(int now) {
    if (now == t) {
        return 1;
    }
    visited[now] = 1;
    for (auto x : vertexs[now]) {
        if (dist[now][x] >= 1) {
            if (visited[x] == 1) continue;
            int hoge = dfs(x);
            if (hoge == 1) {
                dist[now][x]--;
                dist[x][now]++;
                return hoge;
            }
        }
    }
    return 0;
}
int cnt[500];
int expected[500][500];
void solve(){
    cin >> n >> m;
    vector<pair<int, int>> edges;
    REP(i, m) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        edges.push_back(mp(a, b));
        dist[a][b]++;
        dist[b][a]++;
        expected[a][b]++;
        vertexs[a].push_back(b);
        vertexs[b].push_back(a);
    }
    cin >> s >> t;
    s--; t--;
    int answer = 0;
    while (dfs(s)) {
        REP(i, n) {
            visited[i] = 0;
        }
        answer++;
    }
    cout << answer << endl;
    vector<int> ans;
    REP(i, edges.size()) {
        if (dist[edges[i].first][edges[i].second] > expected[edges[i].first][edges[i].second]) {
            ans.push_back(i);
            dist[edges[i].first][edges[i].second]++;
        }
    }
    cout << ans.size() << endl;
    REP(i, ans.size()) {
        cout << ans[i] +1<< endl;
    }
}

#undef int
int main() {
    init();
    solve();
}


Measured memory_bytes: 5344