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;
struct triss {
  long long x;
  long long y;
  double c;
  long long pos;
};
triss a[101000];
triss b[100100];
double res = 0;
bool cmp(triss a, triss b) { return a.c < b.c; }
long long tt[100100];
long long cha[100100];
vector<long long> q;
long long find(long long u) {
  if (u == cha[u])
    return u;
  else
    return find(cha[u]);
}
long long check(double mid) {
  q.clear();
  res = 0;
  for (long long i = 1; i <= n; i++) {
    tt[i] = 0;
    cha[i] = i;
  }
  for (long long i = 1; i <= m; i++) {
    b[i] = a[i];
    if (b[i].x == 1) b[i].c += mid;
  }
  sort(b + 1, b + m + 1, cmp);
  long long cnt = 0;
  for (long long i = 1; i <= m; i++) {
    long long u = find(b[i].x);
    long long v = find(b[i].y);
    if (u == v) continue;
    if (tt[u] == tt[v]) tt[u]++;
    if (tt[u] < tt[v])
      cha[u] = v;
    else
      cha[v] = u;
    q.push_back(b[i].pos);
    res += b[i].c;
    if (b[i].x == 1) cnt++;
  }
  if (cnt == 3) {
  }
  if (cnt == k)
    return 1;
  else if (cnt < k)
    return 0;
  return 2;
}
signed main() {
  cin >> n >> m >> k;
  for (long long i = 1; i <= m; i++) {
    cin >> a[i].x >> a[i].y >> a[i].c;
    if (a[i].x > a[i].y) swap(a[i].x, a[i].y);
    a[i].pos = i;
  }
  double l = -1e6, r = 1e6;
  double ans = 1e9 + 7;
  vector<long long> z;
  long long dcm = 0;
  for (long long i = 1; i <= 500; i++) {
    double mid = (r + l) / 2;
    long long c = check(mid);
    if (c == 1) {
      z = q;
      dcm = 1;
      break;
    } else if (c == 2) {
      l = mid;
    } else
      r = mid;
  }
  if (!dcm) {
    cout << -1;
    return 0;
  }
  cout << n - 1 << '\n';
  for (long long i = 0; i < z.size(); i++) cout << z[i] << ' ';
}