# Break Up

Again, there are hard times in Berland! Many towns have such tensions that even civil war is possible.

There are n towns in Reberland, some pairs of which connected by two-way roads. It is not guaranteed that it is possible to reach one town from any other town using these roads.

Towns s and t announce the final break of any relationship and intend to rule out the possibility of moving between them by the roads. Now possibly it is needed to close several roads so that moving from s to t using roads becomes impossible. Each town agrees to spend money on closing no more than one road, therefore, the total number of closed roads will be no more than two.

Help them find set of no more than two roads such that there will be no way between s and t after closing these roads. For each road the budget required for its closure was estimated. Among all sets find such that the total budget for the closure of a set of roads is minimum.

Input

The first line of the input contains two integers n and m (2 ≤ n ≤ 1000, 0 ≤ m ≤ 30 000) — the number of towns in Berland and the number of roads.

The second line contains integers s and t (1 ≤ s, t ≤ ns ≠ t) — indices of towns which break up the relationships.

Then follow m lines, each of them contains three integers x iy i and w i (1 ≤ x i, y i ≤ n, 1 ≤ w i ≤ 109) — indices of towns connected by the i-th road, and the budget on its closure.

All roads are bidirectional. It is allowed that the pair of towns is connected by more than one road. Roads that connect the city to itself are allowed.

Output

In the first line print the minimum budget required to break up the relations between s and t, if it is allowed to close no more than two roads.

In the second line print the value c (0 ≤ c ≤ 2) — the number of roads to be closed in the found solution.

In the third line print in any order c diverse integers from 1 to m — indices of closed roads. Consider that the roads are numbered from 1 to m in the order they appear in the input.

If it is impossible to make towns s and t disconnected by removing no more than 2 roads, the output should contain a single line -1.

If there are several possible answers, you may print any of them.

Examples

input

6 71 62 1 62 3 53 4 94 6 44 6 54 5 13 1 3

output

822 7

input

6 71 62 3 11 2 21 3 34 5 43 6 54 6 61 5 7

output

924 5

input

5 41 52 1 33 2 13 4 44 5 2

output

112

input

2 31 21 2 7344588401 2 8173800271 2 304764803

output

-1

Solution:

#include <bits/stdc++.h>

using namespace std;

const int inf = (int) 2.1e9;

const int N = 200010;

vector < pair <int, int> > g[N];
int x[N], pr[N];
int path[N], new_path[N];
bool alive[N];
int from[N], to[N], cost[N];

int n, m;

void get_path(int s, int t, int &len, int *p) {
for (int i = 0; i < n; i++) {
pr[i] = -1;
}
int b = 0, e = 1;
x[0] = s;
pr[s] = -2;
while (b < e) {
int sz = g[x[b]].size();
for (int j = 0; j < sz; j++) {
int tov = g[x[b]][j].first;
int id = g[x[b]][j].second;
if (pr[tov] != -1 || !alive[id]) {
continue;
}
x[e] = tov;
pr[tov] = id;
e++;
}
b++;
}
if (pr[t] == -1) {
len = 0;
return;
}
len = 0;
int cur = t;
while (cur != s) {
p[len++] = pr[cur];
cur = from[pr[cur]] + to[pr[cur]] - cur;
}
}

bool was[N];
int depth[N], md[N];
bool bridge[N];

void dfs(int v, int pe) {
was[v] = true;
int sz = g[v].size();
md[v] = depth[v];
for (int j = 0; j < sz; j++) {
int u = g[v][j].first;
int id = g[v][j].second;
if (id == pe || !alive[id]) {
continue;
}
if (!was[u]) {
depth[u] = depth[v] + 1;
dfs(u, id);
md[v] = min(md[v], md[u]);
} else {
md[v] = min(md[v], depth[u]);
}
}
if (pe != -1 && md[v] == depth[v]) {
bridge[pe] = true;
}
}

void get_bridges() {
for (int i = 0; i < m; i++) {
bridge[i] = false;
}
for (int i = 0; i < n; i++) {
was[i] = false;
}
for (int i = 0; i < n; i++) {
if (!was[i]) {
depth[i] = 0;
dfs(i, -1);
}
}
}

int main() {
scanf("%d %d", &n, &m);
int s, t;
scanf("%d %d", &s, &t);
s--; t--;
for (int i = 0; i < n; i++) {
g[i].clear();
}
for (int i = 0; i < m; i++) {
scanf("%d %d %d", from + i, to + i, cost + i);
from[i]--; to[i]--;
if (from[i] != to[i]) {
g[from[i]].push_back(make_pair(to[i], i));
g[to[i]].push_back(make_pair(from[i], i));
alive[i] = true;
}
}
get_bridges();
int plen = 0;
get_path(s, t, plen, path);
int best = inf;
vector <int> res;
res.clear();
if (plen == 0) {
best = 0;
}
for (int pos = 0; pos < plen; pos++) {
int id_a = path[pos];
alive[id_a] = false;
int new_plen = 0;
get_path(s, t, new_plen, new_path);
if (new_plen == 0) {
if (cost[id_a] < best) {
best = cost[id_a];
res.clear();
res.push_back(id_a);
}
} else {
get_bridges();
for (int new_pos = 0; new_pos < new_plen; new_pos++) {
int id_b = new_path[new_pos];
if (bridge[id_b]) {
if (cost[id_a] + cost[id_b] < best) {
best = cost[id_a] + cost[id_b];
res.clear();
res.push_back(id_a);
res.push_back(id_b);
}
}
}
}
alive[id_a] = true;
}
if (best == inf) {
printf("%d\n", -1);
return 0;
}
sort(res.begin(), res.end());
printf("%d\n", best);
int sz = res.size();
printf("%d\n", sz);
for (int i = 0; i < sz; i++) {
if (i > 0) {
putchar(' ');
}
printf("%d", 1 + res[i]);
}
printf("\n");
return 0;
}