#include <bits/stdc++.h>
using namespace std;
struct ed {
  int pre, to, w, id;
} edge[100010];
int at = 1, ptr[100010];
int n, m, ss, tt, val[30010];
int ban;
int ans1c, ans2c;
int e1, e2a, e2b;
template <typename int_t>
void readx(int_t &x) {
  x = 0;
  int_t k = 1;
  char ch = 0;
  while (ch < '0' || ch > '9') {
    ch = getchar();
    if (ch == '-') k = -1;
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= k;
}
void Is(int u, int v, int w, int id) {
  at++;
  edge[at].pre = ptr[u];
  edge[at].to = v;
  edge[at].w = w;
  edge[at].id = id;
  ptr[u] = at;
  at++;
  edge[at].pre = ptr[v];
  edge[at].to = u;
  edge[at].w = w;
  edge[at].id = id;
  ptr[v] = at;
}
int dfn[1010], low[1010], tcnt = 0;
bool bri[30010];
void Tarjan(int u, int fr) {
  dfn[u] = low[u] = ++tcnt;
  for (int v = ptr[u]; v; v = edge[v].pre)
    if (edge[v].id != ban) {
      if (!dfn[edge[v].to]) {
        Tarjan(edge[v].to, edge[v].id);
        low[u] = min(low[u], low[edge[v].to]);
        if (low[edge[v].to] > dfn[u]) {
          bri[edge[v].id] = 1;
        }
      } else if (edge[v].id != fr) {
        low[u] = min(low[u], dfn[edge[v].to]);
      }
    }
}
int nnv[1010];
int vis[1010];
int toban[30010];
bool DFS(int u) {
  if (u == tt) return true;
  vis[u] = 1;
  for (int v = ptr[u]; v; v = edge[v].pre)
    if (edge[v].id != ban) {
      if (!vis[edge[v].to] && DFS(edge[v].to)) {
        nnv[u] = v;
        return true;
      }
    }
  return false;
}
int main() {
  ans1c = ans2c = 2 * 1e9 + 100;
  readx(n);
  readx(m);
  readx(ss);
  readx(tt);
  int u, v, w;
  ban = 0;
  for (int i = 1; i <= m; i++) {
    readx(u);
    readx(v);
    readx(w);
    Is(u, v, w, i);
    val[i] = w;
  }
  if (!DFS(ss)) {
    printf("0\n0\n");
    return 0;
  }
  for (int i = 1; i <= n; i++)
    if (nnv[i]) toban[edge[nnv[i]].id] = 1;
  for (ban = 1; ban <= m; ban++)
    if (toban[ban]) {
      for (int i = 1; i <= n; i++) vis[i] = nnv[i] = 0;
      bool ok = DFS(ss);
      if (!ok) {
        if (ans1c > val[ban]) {
          ans1c = val[ban];
          e1 = ban;
        }
      } else {
        for (int i = 1; i <= m; i++) bri[i] = 0;
        for (int i = 1; i <= n; i++) dfn[i] = low[i] = 0;
        tcnt = 0;
        Tarjan(ss, -1);
        int tmp = ss;
        while (tmp != tt) {
          if (bri[edge[nnv[tmp]].id]) {
            if (ans2c > edge[nnv[tmp]].w + val[ban]) {
              ans2c = edge[nnv[tmp]].w + val[ban];
              e2a = edge[nnv[tmp]].id;
              e2b = ban;
            }
          }
          tmp = edge[nnv[tmp]].to;
        }
      }
    }
  if (ans1c == ans2c && ans2c == 2 * 1e9 + 100) {
    printf("-1\n");
    return 0;
  }
  if (ans1c <= ans2c) {
    printf("%d\n1\n%d\n", ans1c, e1);
  } else {
    printf("%d\n2\n%d %d\n", ans2c, min(e2a, e2b), max(e2a, e2b));
  }
  return 0;
}

### Prompt

Please provide a cpp coded solution to the problem described below:

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 ≤ n, s ≠ t) — indices of towns which break up the relationships.

Then follow m lines, each of them contains three integers xi, yi and wi (1 ≤ xi, yi ≤ n, 1 ≤ wi ≤ 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 7
1 6
2 1 6
2 3 5
3 4 9
4 6 4
4 6 5
4 5 1
3 1 3


Output

8
2
2 7


Input

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


Output

9
2
4 5


Input

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


Output

1
1
2


Input

2 3
1 2
1 2 734458840
1 2 817380027
1 2 304764803


Output

-1

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
struct ed {
  int pre, to, w, id;
} edge[100010];
int at = 1, ptr[100010];
int n, m, ss, tt, val[30010];
int ban;
int ans1c, ans2c;
int e1, e2a, e2b;
template <typename int_t>
void readx(int_t &x) {
  x = 0;
  int_t k = 1;
  char ch = 0;
  while (ch < '0' || ch > '9') {
    ch = getchar();
    if (ch == '-') k = -1;
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= k;
}
void Is(int u, int v, int w, int id) {
  at++;
  edge[at].pre = ptr[u];
  edge[at].to = v;
  edge[at].w = w;
  edge[at].id = id;
  ptr[u] = at;
  at++;
  edge[at].pre = ptr[v];
  edge[at].to = u;
  edge[at].w = w;
  edge[at].id = id;
  ptr[v] = at;
}
int dfn[1010], low[1010], tcnt = 0;
bool bri[30010];
void Tarjan(int u, int fr) {
  dfn[u] = low[u] = ++tcnt;
  for (int v = ptr[u]; v; v = edge[v].pre)
    if (edge[v].id != ban) {
      if (!dfn[edge[v].to]) {
        Tarjan(edge[v].to, edge[v].id);
        low[u] = min(low[u], low[edge[v].to]);
        if (low[edge[v].to] > dfn[u]) {
          bri[edge[v].id] = 1;
        }
      } else if (edge[v].id != fr) {
        low[u] = min(low[u], dfn[edge[v].to]);
      }
    }
}
int nnv[1010];
int vis[1010];
int toban[30010];
bool DFS(int u) {
  if (u == tt) return true;
  vis[u] = 1;
  for (int v = ptr[u]; v; v = edge[v].pre)
    if (edge[v].id != ban) {
      if (!vis[edge[v].to] && DFS(edge[v].to)) {
        nnv[u] = v;
        return true;
      }
    }
  return false;
}
int main() {
  ans1c = ans2c = 2 * 1e9 + 100;
  readx(n);
  readx(m);
  readx(ss);
  readx(tt);
  int u, v, w;
  ban = 0;
  for (int i = 1; i <= m; i++) {
    readx(u);
    readx(v);
    readx(w);
    Is(u, v, w, i);
    val[i] = w;
  }
  if (!DFS(ss)) {
    printf("0\n0\n");
    return 0;
  }
  for (int i = 1; i <= n; i++)
    if (nnv[i]) toban[edge[nnv[i]].id] = 1;
  for (ban = 1; ban <= m; ban++)
    if (toban[ban]) {
      for (int i = 1; i <= n; i++) vis[i] = nnv[i] = 0;
      bool ok = DFS(ss);
      if (!ok) {
        if (ans1c > val[ban]) {
          ans1c = val[ban];
          e1 = ban;
        }
      } else {
        for (int i = 1; i <= m; i++) bri[i] = 0;
        for (int i = 1; i <= n; i++) dfn[i] = low[i] = 0;
        tcnt = 0;
        Tarjan(ss, -1);
        int tmp = ss;
        while (tmp != tt) {
          if (bri[edge[nnv[tmp]].id]) {
            if (ans2c > edge[nnv[tmp]].w + val[ban]) {
              ans2c = edge[nnv[tmp]].w + val[ban];
              e2a = edge[nnv[tmp]].id;
              e2b = ban;
            }
          }
          tmp = edge[nnv[tmp]].to;
        }
      }
    }
  if (ans1c == ans2c && ans2c == 2 * 1e9 + 100) {
    printf("-1\n");
    return 0;
  }
  if (ans1c <= ans2c) {
    printf("%d\n1\n%d\n", ans1c, e1);
  } else {
    printf("%d\n2\n%d %d\n", ans2c, min(e2a, e2b), max(e2a, e2b));
  }
  return 0;
}

```