Problem: The MST (Meaningless State Team) company won another tender for an important state reform in Berland.

There are n cities in Berland, some pairs of the cities are connected by roads. Each road has its price. One can move along any road in any direction. The MST team should carry out the repair works on some set of roads such that one can get from any city to any other one moving only along the repaired roads. Moreover, this set should contain exactly k capital roads (that is, the roads that start or finish in the capital). The number of the capital is 1.

As the budget has already been approved, the MST Company will profit by finding the set with minimum lengths of roads.

Input

The first input line contains three integers n, m, k (1 ≤ n ≤ 5000;0 ≤ m ≤ 105;0 ≤ k < 5000), where n is the number of cities in the country, m is the number of roads in the country, k is the number of capital roads in the required set. Then m lines enumerate the roads in question. Each road is specified by three numbers ai, bi, wi (1 ≤ ai, bi ≤ n; 1 ≤ w ≤ 105), where ai, bi are the numbers of cities linked by a road and wi is its length. 

Between each pair of cities no more than one road exists. There are no roads that start and finish in one city. The capital's number is 1.

Output

In the first line print the number of roads in the required set. The second line should contain the numbers of roads included in the sought set. If the sought set does not exist, print -1.

Examples

Input

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


Output

3
1 5 2 

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long long n, m, k, id[5005];
vector<pair<pair<long double, long long>, pair<long long, long long> > > ed,
    ed1;
vector<pair<long long, pair<long long, long long> > > edges[200005];
vector<pair<long long, pair<long long, long long> > > edges2;
vector<long long> ans;
long long root(long long x) {
  if (id[x] == x) return x;
  return id[x] = root(id[x]);
}
void union1(long long x, long long y) {
  long long p = root(x);
  long long q = root(y);
  id[p] = id[q];
}
long long dfs(long double val) {
  long long cnt = 0;
  ed1 = ed;
  for (long long i = 1; i <= n; i++) id[i] = i;
  for (long long i = 0; i < (long long)ed1.size(); i++) {
    if (ed1[i].second.first == 1) ed1[i].first.first += val;
  }
  sort(ed1.begin(), ed1.end());
  for (long long i = 0; i < ed1.size(); i++) {
    long long x = ed1[i].second.first;
    long long y = ed1[i].second.second;
    long long s1 = root(x);
    long long s2 = root(y);
    if (s1 != s2) {
      id[s2] = s1;
      if (x == 1) cnt++;
      ans.push_back(ed1[i].first.second);
    }
  }
  return cnt;
}
long long kruskal(vector<pair<long long, pair<long long, long long> > > p) {
  for (long long i = 0; i < 200005; i++) id[i] = i;
  long long x, y;
  long long count = 0;
  long long cost, minimumCost = 0;
  for (long long i = 0; i < p.size(); ++i) {
    x = p[i].second.first;
    y = p[i].second.second;
    cost = p[i].first;
    if (root(x) != root(y)) {
      count++;
      minimumCost += cost;
      union1(x, y);
      if (count == (n - 1)) return minimumCost;
    }
  }
  if (count < (n - 1)) return -1;
  return minimumCost;
}
signed main() {
  cin >> n >> m >> k;
  for (long long i = 1; i <= m; i++) {
    long long u, v, w;
    cin >> u >> v >> w;
    if (u > v) swap(u, v);
    ed.push_back(make_pair(make_pair(w, i), make_pair(u, v)));
    edges[i].push_back({w, {u, v}});
  }
  long double lo = -1e12, high = 1e12;
  for (long long i = 0; i < 200; i++) {
    ans.clear();
    long double mid = (lo + high) / 2;
    if (dfs(mid) < k)
      high = mid;
    else
      lo = mid;
  }
  ans.clear();
  if (dfs(lo) != k) {
    printf("-1\n");
    return 0;
  }
  cout << ans.size() << "\n";
  for (long long i = 0; i < ans.size(); i++) {
    auto v = edges[ans[i]][0];
    edges2.push_back(v);
    cout << ans[i] << " ";
  }
  sort(edges2.begin(), edges2.end());
  return 0;
}