#include <bits/stdc++.h>
using namespace std;
struct edge {
  long long to, id;
  edge() {}
  edge(long long a, long long b) { to = a, id = b; }
};
const long long dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
const long long mod = 1000000007;
struct mint {
  long long x = 0;
  mint(long long y = 0) {
    x = y;
    if (x < 0 || x >= mod) x = (x % mod + mod) % mod;
  }
  mint(const mint& ope) { x = ope.x; }
  mint operator-() { return mint(-x); }
  mint operator+(const mint& ope) { return mint(x) += ope; }
  mint operator-(const mint& ope) { return mint(x) -= ope; }
  mint operator*(const mint& ope) { return mint(x) *= ope; }
  mint operator/(const mint& ope) { return mint(x) /= ope; }
  mint& operator+=(const mint& ope) {
    x += ope.x;
    if (x >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint& ope) {
    x += mod - ope.x;
    if (x >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint& ope) {
    x *= ope.x, x %= mod;
    return *this;
  }
  mint& operator/=(const mint& ope) {
    long long n = mod - 2;
    mint mul = ope;
    while (n) {
      if (n & 1) *this *= mul;
      mul *= mul;
      n >>= 1;
    }
    return *this;
  }
  mint inverse() { return mint(1) / *this; }
  bool operator==(const mint& ope) { return x == ope.x; }
  bool operator!=(const mint& ope) { return x != ope.x; }
};
mint modpow(mint a, long long n) {
  if (n == 0) return mint(1);
  if (n % 2)
    return a * modpow(a, n - 1);
  else
    return modpow(a * a, n / 2);
}
istream& operator>>(istream& is, mint& ope) {
  long long t;
  is >> t, ope.x = t;
  return is;
}
ostream& operator<<(ostream& os, mint& ope) { return os << ope.x; }
ostream& operator<<(ostream& os, const mint& ope) { return os << ope.x; }
bool exceed(long long x, long long y, long long m) { return x >= m / y + 1; }
void mark() { cout << "*" << endl; }
void yes() { cout << "YES" << endl; }
void no() { cout << "NO" << endl; }
long long sgn(long long x) {
  if (x > 0) return 1;
  if (x < 0) return -1;
  return 0;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long digitnum(long long x, long long b = 10) {
  long long ret = 0;
  for (; x; x /= b) ret++;
  return ret;
}
long long digitsum(long long x, long long b = 10) {
  long long ret = 0;
  for (; x; x /= b) ret += x % b;
  return ret;
}
string lltos(long long x) {
  string ret;
  for (; x; x /= 10) ret += x % 10 + '0';
  reverse(ret.begin(), ret.end());
  return ret;
}
long long stoll(string& s) {
  long long ret = 0;
  for (auto c : s) ret *= 10, ret += c - '0';
  return ret;
}
template <typename T>
void uniq(T& vec) {
  sort(vec.begin(), vec.end());
  vec.erase(unique(vec.begin(), vec.end()), vec.end());
}
template <typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
  for (int i = 0; i < vec.size(); i++)
    os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, deque<T>& deq) {
  for (int i = 0; i < deq.size(); i++)
    os << deq[i] << (i + 1 == deq.size() ? "" : " ");
  return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& pair_var) {
  os << "(" << pair_var.first << ", " << pair_var.second << ")";
  return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& pair_var) {
  os << "(" << pair_var.first << ", " << pair_var.second << ")";
  return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, map<T, U>& map_var) {
  for (typename map<T, U>::iterator itr = map_var.begin(); itr != map_var.end();
       itr++) {
    os << "(" << itr->first << ", " << itr->second << ")";
    itr++;
    if (itr != map_var.end()) os << ",";
    itr--;
  }
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, set<T>& set_var) {
  for (typename set<T>::iterator itr = set_var.begin(); itr != set_var.end();
       itr++) {
    os << *itr;
    ++itr;
    if (itr != set_var.end()) os << " ";
    itr--;
  }
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, multiset<T>& set_var) {
  for (typename multiset<T>::iterator itr = set_var.begin();
       itr != set_var.end(); itr++) {
    os << *itr;
    ++itr;
    if (itr != set_var.end()) os << " ";
    itr--;
  }
  return os;
}
template <typename T>
void outa(T a[], long long s, long long t) {
  for (long long i = s; i <= t; i++) {
    cout << a[i];
    if (i < t) cout << " ";
  }
  cout << endl;
}
void dump_func() { cout << endl; }
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(Tail) > 0) cout << " ";
  dump_func(std::move(tail)...);
}
long long n, m, s, t;
long long u[30005], v[30005], w[30005];
set<pair<long long, long long> > G[1005];
long long dist[1005], vpre[1005], epre[1005];
void bfs() {
  queue<int> Q;
  Q.push(s);
  for (int i = 1; i <= n; i++) dist[i] = 1e18;
  dist[s] = 0;
  while (Q.size()) {
    int v = Q.front();
    Q.pop();
    for (auto e : G[v]) {
      long long u = e.first, id = e.second;
      if (dist[u] < 1e18 / 2) continue;
      Q.push(u);
      dist[u] = dist[v] + 1;
      vpre[u] = v, epre[u] = id;
    }
  }
}
set<long long> S;
int pre[100005], low[100005];
int id;
int bridge_dfs(int v, int eid) {
  pre[v] = id++;
  int ret = pre[v];
  for (auto e : G[v]) {
    long long u = e.first, id = e.second;
    if (id == eid) continue;
    if (pre[u])
      ret = min(ret, pre[u]);
    else
      ret = min(ret, bridge_dfs(u, id));
  }
  return low[v] = ret;
}
void findBridge(int v = 1) {
  id = 1, S.clear();
  for (long long(i) = (1); (i) <= (n); (i)++) pre[i] = low[i] = 0;
  bridge_dfs(v, 0);
  for (int i = 1; i <= n; i++) {
    for (auto e : G[i]) {
      long long u = e.first;
      if (pre[i] < pre[u] && low[u] > pre[i]) S.insert(e.second);
    }
  }
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> s >> t;
  for (long long(i) = (1); (i) <= (m); (i)++) cin >> u[i] >> v[i] >> w[i];
  for (long long(i) = (1); (i) <= (m); (i)++) {
    G[u[i]].insert(pair<long long, long long>(v[i], i));
    G[v[i]].insert(pair<long long, long long>(u[i], i));
  }
  bfs();
  if (dist[t] > 1e18 / 2) {
    dump_func(0);
    dump_func(0);
    return 0;
  }
  vector<long long> vec;
  long long p = t;
  while (p != s) {
    vec.push_back(epre[p]);
    p = vpre[p];
  }
  long long ans = 1e18;
  vector<long long> avec;
  for (auto i : vec) {
    G[u[i]].erase(pair<long long, long long>(v[i], i));
    G[v[i]].erase(pair<long long, long long>(u[i], i));
    bfs();
    if (dist[t] > 1e18 / 2) {
      if (ans > w[i]) {
        ans = w[i];
        avec.clear();
        avec.push_back(i);
      }
    } else {
      findBridge(s);
      long long v = t;
      while (v != s) {
        long long eid = epre[v];
        if (S.count(eid)) {
          if (ans > w[i] + w[eid]) {
            ans = w[i] + w[eid];
            avec.clear();
            avec.push_back(i);
            avec.push_back(eid);
          }
        }
        v = vpre[v];
      }
    }
    G[u[i]].insert(pair<long long, long long>(v[i], i));
    G[v[i]].insert(pair<long long, long long>(u[i], i));
  }
  if (ans > 1e18 / 2) {
    dump_func(-1);
    return 0;
  }
  dump_func(ans);
  dump_func(((long long)(avec).size()));
  dump_func(avec);
  return 0;
}

### Prompt

Generate a CPP solution to the following problem:

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 edge {
  long long to, id;
  edge() {}
  edge(long long a, long long b) { to = a, id = b; }
};
const long long dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
const long long mod = 1000000007;
struct mint {
  long long x = 0;
  mint(long long y = 0) {
    x = y;
    if (x < 0 || x >= mod) x = (x % mod + mod) % mod;
  }
  mint(const mint& ope) { x = ope.x; }
  mint operator-() { return mint(-x); }
  mint operator+(const mint& ope) { return mint(x) += ope; }
  mint operator-(const mint& ope) { return mint(x) -= ope; }
  mint operator*(const mint& ope) { return mint(x) *= ope; }
  mint operator/(const mint& ope) { return mint(x) /= ope; }
  mint& operator+=(const mint& ope) {
    x += ope.x;
    if (x >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint& ope) {
    x += mod - ope.x;
    if (x >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint& ope) {
    x *= ope.x, x %= mod;
    return *this;
  }
  mint& operator/=(const mint& ope) {
    long long n = mod - 2;
    mint mul = ope;
    while (n) {
      if (n & 1) *this *= mul;
      mul *= mul;
      n >>= 1;
    }
    return *this;
  }
  mint inverse() { return mint(1) / *this; }
  bool operator==(const mint& ope) { return x == ope.x; }
  bool operator!=(const mint& ope) { return x != ope.x; }
};
mint modpow(mint a, long long n) {
  if (n == 0) return mint(1);
  if (n % 2)
    return a * modpow(a, n - 1);
  else
    return modpow(a * a, n / 2);
}
istream& operator>>(istream& is, mint& ope) {
  long long t;
  is >> t, ope.x = t;
  return is;
}
ostream& operator<<(ostream& os, mint& ope) { return os << ope.x; }
ostream& operator<<(ostream& os, const mint& ope) { return os << ope.x; }
bool exceed(long long x, long long y, long long m) { return x >= m / y + 1; }
void mark() { cout << "*" << endl; }
void yes() { cout << "YES" << endl; }
void no() { cout << "NO" << endl; }
long long sgn(long long x) {
  if (x > 0) return 1;
  if (x < 0) return -1;
  return 0;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long digitnum(long long x, long long b = 10) {
  long long ret = 0;
  for (; x; x /= b) ret++;
  return ret;
}
long long digitsum(long long x, long long b = 10) {
  long long ret = 0;
  for (; x; x /= b) ret += x % b;
  return ret;
}
string lltos(long long x) {
  string ret;
  for (; x; x /= 10) ret += x % 10 + '0';
  reverse(ret.begin(), ret.end());
  return ret;
}
long long stoll(string& s) {
  long long ret = 0;
  for (auto c : s) ret *= 10, ret += c - '0';
  return ret;
}
template <typename T>
void uniq(T& vec) {
  sort(vec.begin(), vec.end());
  vec.erase(unique(vec.begin(), vec.end()), vec.end());
}
template <typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
  for (int i = 0; i < vec.size(); i++)
    os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, deque<T>& deq) {
  for (int i = 0; i < deq.size(); i++)
    os << deq[i] << (i + 1 == deq.size() ? "" : " ");
  return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& pair_var) {
  os << "(" << pair_var.first << ", " << pair_var.second << ")";
  return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& pair_var) {
  os << "(" << pair_var.first << ", " << pair_var.second << ")";
  return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, map<T, U>& map_var) {
  for (typename map<T, U>::iterator itr = map_var.begin(); itr != map_var.end();
       itr++) {
    os << "(" << itr->first << ", " << itr->second << ")";
    itr++;
    if (itr != map_var.end()) os << ",";
    itr--;
  }
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, set<T>& set_var) {
  for (typename set<T>::iterator itr = set_var.begin(); itr != set_var.end();
       itr++) {
    os << *itr;
    ++itr;
    if (itr != set_var.end()) os << " ";
    itr--;
  }
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, multiset<T>& set_var) {
  for (typename multiset<T>::iterator itr = set_var.begin();
       itr != set_var.end(); itr++) {
    os << *itr;
    ++itr;
    if (itr != set_var.end()) os << " ";
    itr--;
  }
  return os;
}
template <typename T>
void outa(T a[], long long s, long long t) {
  for (long long i = s; i <= t; i++) {
    cout << a[i];
    if (i < t) cout << " ";
  }
  cout << endl;
}
void dump_func() { cout << endl; }
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(Tail) > 0) cout << " ";
  dump_func(std::move(tail)...);
}
long long n, m, s, t;
long long u[30005], v[30005], w[30005];
set<pair<long long, long long> > G[1005];
long long dist[1005], vpre[1005], epre[1005];
void bfs() {
  queue<int> Q;
  Q.push(s);
  for (int i = 1; i <= n; i++) dist[i] = 1e18;
  dist[s] = 0;
  while (Q.size()) {
    int v = Q.front();
    Q.pop();
    for (auto e : G[v]) {
      long long u = e.first, id = e.second;
      if (dist[u] < 1e18 / 2) continue;
      Q.push(u);
      dist[u] = dist[v] + 1;
      vpre[u] = v, epre[u] = id;
    }
  }
}
set<long long> S;
int pre[100005], low[100005];
int id;
int bridge_dfs(int v, int eid) {
  pre[v] = id++;
  int ret = pre[v];
  for (auto e : G[v]) {
    long long u = e.first, id = e.second;
    if (id == eid) continue;
    if (pre[u])
      ret = min(ret, pre[u]);
    else
      ret = min(ret, bridge_dfs(u, id));
  }
  return low[v] = ret;
}
void findBridge(int v = 1) {
  id = 1, S.clear();
  for (long long(i) = (1); (i) <= (n); (i)++) pre[i] = low[i] = 0;
  bridge_dfs(v, 0);
  for (int i = 1; i <= n; i++) {
    for (auto e : G[i]) {
      long long u = e.first;
      if (pre[i] < pre[u] && low[u] > pre[i]) S.insert(e.second);
    }
  }
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> s >> t;
  for (long long(i) = (1); (i) <= (m); (i)++) cin >> u[i] >> v[i] >> w[i];
  for (long long(i) = (1); (i) <= (m); (i)++) {
    G[u[i]].insert(pair<long long, long long>(v[i], i));
    G[v[i]].insert(pair<long long, long long>(u[i], i));
  }
  bfs();
  if (dist[t] > 1e18 / 2) {
    dump_func(0);
    dump_func(0);
    return 0;
  }
  vector<long long> vec;
  long long p = t;
  while (p != s) {
    vec.push_back(epre[p]);
    p = vpre[p];
  }
  long long ans = 1e18;
  vector<long long> avec;
  for (auto i : vec) {
    G[u[i]].erase(pair<long long, long long>(v[i], i));
    G[v[i]].erase(pair<long long, long long>(u[i], i));
    bfs();
    if (dist[t] > 1e18 / 2) {
      if (ans > w[i]) {
        ans = w[i];
        avec.clear();
        avec.push_back(i);
      }
    } else {
      findBridge(s);
      long long v = t;
      while (v != s) {
        long long eid = epre[v];
        if (S.count(eid)) {
          if (ans > w[i] + w[eid]) {
            ans = w[i] + w[eid];
            avec.clear();
            avec.push_back(i);
            avec.push_back(eid);
          }
        }
        v = vpre[v];
      }
    }
    G[u[i]].insert(pair<long long, long long>(v[i], i));
    G[v[i]].insert(pair<long long, long long>(u[i], i));
  }
  if (ans > 1e18 / 2) {
    dump_func(-1);
    return 0;
  }
  dump_func(ans);
  dump_func(((long long)(avec).size()));
  dump_func(avec);
  return 0;
}

```