#include <bits/stdc++.h>
using namespace std;
const int INF = 16000;
int F[405][405], N, K, par[405], pv[405];
short distr[405][405][405];
vector<pair<int, int> > adj[405];
void dfs(int x, int p = -1) {
  for (int k = 0; k < K; ++k) distr[x][0][k] = INF;
  distr[x][0][0] = 0;
  int prev = 0;
  for (auto i = adj[x].begin(); i != adj[x].end(); ++i) {
    int v = i->first, e = i->second;
    if (v == p) {
      par[x] = e;
      continue;
    }
    dfs(v, x);
    pv[v] = prev;
    for (int k = K - 1; k >= 0; --k) {
      distr[x][v][k] = INF;
      for (int m = 0; m <= k; ++m) {
        short d = distr[x][prev][k - m] + F[v][m];
        distr[x][v][k] = min(distr[x][v][k], d);
      }
    }
    prev = v;
  }
  for (int k = 0; k <= K; ++k) {
    F[x][k] = k ? distr[x][prev][k - 1] : 1;
  }
}
void printans(int x, int k, int p = -1) {
  if (!k) {
    printf("%d ", par[x]);
    return;
  }
  --k;
  for (auto i = adj[x].rbegin(); i != adj[x].rend(); ++i) {
    int v = i->first, e = i->second;
    if (v == p) continue;
    for (int m = 0; m <= k; ++m) {
      int d = distr[x][pv[v]][k - m] + F[v][m];
      if (d == distr[x][v][k]) {
        printans(v, m, x);
        k -= m;
        break;
      }
    }
  }
}
int main() {
  scanf("%d%d", &N, &K);
  for (int i = 1; i < N; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(make_pair(v, i));
    adj[v].push_back(make_pair(u, i));
  }
  dfs(1);
  int ans = INF;
  for (int i = 1; i <= N; ++i) {
    int val = F[i][K] + (i != 1);
    ans = min(ans, val);
  }
  printf("%d\n", ans);
  for (int i = 1; i <= N; ++i) {
    int val = F[i][K] + (i != 1);
    if (val == ans) {
      if (i != 1) printf("%d ", par[i]);
      printans(i, K);
      break;
    }
  }
  printf("\n");
}
