#include <bits/stdc++.h>
using namespace std;
int n, f[405][405], tmp[405], Map[405][405], k, res = 1e9, Trace;
vector<int> a[405];
vector<int> mem[405][405], vec[405][405];
void dfs(int u, int par) {
  f[u][1] = 0;
  for (int v : a[u]) {
    if (v == par) continue;
    dfs(v, u);
    for (int i = 1; i <= k; ++i) {
      tmp[i] = f[u][i] + 1;
      vec[u][i].push_back(Map[u][v]);
    }
    for (int i = 1; i <= k; ++i) {
      for (int j = 1; j + i <= k; ++j)
        if (tmp[i + j] > f[u][i] + f[v][j]) {
          tmp[i + j] = f[u][i] + f[v][j];
          vec[u][i + j].resize(0);
          for (int x : mem[u][i]) vec[u][i + j].push_back(x);
          for (int x : mem[v][j]) vec[u][i + j].push_back(x);
        }
    }
    for (int i = 1; i <= k; ++i) {
      f[u][i] = tmp[i];
      tmp[i] = 1e9;
      mem[u][i] = vec[u][i];
    }
  }
  if (u != par) mem[u][k].push_back(Map[u][par]);
  if (res > f[u][k] + (u != par)) res = f[u][k] + (u != par), Trace = u;
}
int main() {
  cin >> n >> k;
  if (n == k) {
    cout << 0;
    return 0;
  }
  int u, v;
  for (int i = 1; i < n; ++i) {
    cin >> u >> v;
    a[u].push_back(v);
    a[v].push_back(u);
    Map[u][v] = Map[v][u] = i;
  }
  for (int i = 0; i <= k; ++i) tmp[i] = 1e9;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= k; ++j) f[i][j] = 1e9;
  }
  dfs(1, 1);
  cout << res << '\n';
  sort(mem[Trace][k].begin(), mem[Trace][k].end());
  for (int x : mem[Trace][k]) cout << x << " ";
  return 0;
}
