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;
struct Edge {
  int u, v, id;
  long double w;
  Edge() {}
  Edge(int u, int v, long double w, int id) : u(u), v(v), w(w), id(id) {}
  bool operator<(const Edge &d) const { return w < d.w; }
};
const int N = (int)5e3 + 10;
const int M = (int)1e5 + 10;
const int INF = (int)1e6;
int n, m, k, deg[N];
int cnt, ans[N], p[N];
Edge G[M], E[M];
int Root(int u) {
  if (p[u] < 0) return u;
  return p[u] = Root(p[u]);
}
bool Merge(int u, int v) {
  u = Root(u);
  v = Root(v);
  if (u == v) return false;
  if (p[u] > p[v]) swap(u, v);
  p[u] += p[v];
  p[v] = u;
  return true;
}
int MST(long double x) {
  for (int i = 1; i <= m; ++i) {
    E[i] = G[i];
    if (E[i].u == 1 || E[i].v == 1) E[i].w += x;
  }
  for (int i = 1; i <= n; ++i) p[i] = -1;
  sort(E + 1, E + m + 1);
  int d = cnt = 0;
  for (int i = 1; i <= m; ++i) {
    int u = E[i].u, v = E[i].v;
    if (Merge(u, v)) ans[++cnt] = E[i].id, d += (u == 1 || v == 1);
  }
  return d;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= m; ++i) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &w);
    G[i] = Edge(u, v, w, i);
    deg[G[i].u]++;
    deg[G[i].v]++;
  }
  long double l = -INF, r = INF, f = 2 * INF;
  for (int i = 1; i <= 200; ++i) {
    long double m = (l + r) / 2;
    int R = MST(m);
    if (R >= k) {
      if (R == k) f = m;
      l = m;
    } else
      r = m;
  }
  if (abs(f - 2 * INF) < 1e-9) {
    puts("-1");
    return 0;
  }
  MST(f);
  assert(cnt == n - 1);
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; ++i) printf("%d ", ans[i]);
  return 0;
}