#include <bits/stdc++.h>
inline int getint() {
  register char ch;
  while (!isdigit(ch = getchar()))
    ;
  register int x = ch ^ '0';
  while (isdigit(ch = getchar())) x = (((x << 2) + x) << 1) + (ch ^ '0');
  return x;
}
const int inf = 0x7fffffff;
const int N = 401;
struct Edge {
  int to, id;
};
std::vector<Edge> e[N];
inline void add_edge(const int &u, const int &v, const int &i) {
  e[u].push_back((Edge){v, i});
  e[v].push_back((Edge){u, i});
}
int size[N], f[N][N];
int t[N], pre[N];
std::vector<int> v[N][N];
void dfs(const int &x, const int &par) {
  size[x] = 1;
  int eid;
  for (unsigned i = 0; i < e[x].size(); i++) {
    const int &y = e[x][i].to;
    if (y == par) {
      eid = e[x][i].id;
      continue;
    }
    pre[y] = e[x][i].id;
    dfs(y, x);
    size[x] += size[y];
  }
  f[x][0] = 0;
  f[x][size[x]] = 1;
  v[x][size[x]].push_back(eid);
  std::fill(&f[x][1], &f[x][size[x]], inf);
  for (unsigned i = 0; i < e[x].size(); i++) {
    const int &y = e[x][i].to;
    eid = e[x][i].id;
    if (y == par) continue;
    memcpy(t, f[x], sizeof t);
    for (int j = 0; j <= size[y]; j++) {
      for (int k = 0; k < size[x] - j; k++) {
        if (f[x][k] == inf) continue;
        if (f[x][k] + f[y][j] < t[k + j]) {
          t[k + j] = f[x][k] + f[y][j];
          v[x][k + j] = v[x][k];
          v[x][k + j].insert(v[x][k + j].end(), v[y][j].begin(), v[y][j].end());
        }
      }
    }
    memcpy(f[x], t, sizeof t);
  }
}
int main() {
  int n = getint(), k = getint();
  for (register int i = 1; i < n; i++) {
    add_edge(getint(), getint(), i);
  }
  dfs(1, 0);
  int ans = f[1][size[1] - k], node = 1;
  for (register int root = 2; root <= n; root++) {
    if (size[root] < k) continue;
    f[root][size[root] - k]++;
    v[root][size[root] - k].push_back(pre[root]);
    if (f[root][size[root] - k] < ans) {
      ans = f[root][size[root] - k];
      node = root;
    }
  }
  printf("%d\n", ans);
  for (register unsigned i = 0; i < v[node][size[node] - k].size(); i++) {
    printf("%d ", v[node][size[node] - k][i]);
  }
  return 0;
}
