#include <bits/stdc++.h>
using namespace std;
const int MAXN = 400 + 1, INF = 1e3;
int n, k, u, v, ans, ind, par[MAXN], dp[MAXN][MAXN], p[MAXN][MAXN][MAXN];
vector<pair<int, int> > adj[MAXN];
void dfs(int v) {
  dp[v][0] = 1, dp[v][1] = 0;
  for (int i = 0; i < (int)adj[v].size(); i++) {
    if (par[v] == adj[v][i].first) continue;
    par[adj[v][i].first] = v, dfs(adj[v][i].first);
    for (int j = k; j > 1; j--)
      if (!dp[v][1])
        dp[v][j] = dp[adj[v][i].first][j - 1], p[v][i][j] = j - 1;
      else {
        if (!dp[v][1])
          dp[v][j] = INF, p[v][i][j] = INF;
        else
          dp[v][j]++, p[v][i][j] = 0;
        for (int t = j - 1; t > 0; t--)
          if (dp[v][j - t] + dp[adj[v][i].first][t] < dp[v][j])
            dp[v][j] = dp[v][j - t] + dp[adj[v][i].first][t], p[v][i][j] = t;
      }
    dp[v][1]++, p[v][i][1] = 0;
  }
  int ansp = dp[v][k] + (par[v] != -1);
  if (ansp < ans) ans = ansp, ind = v;
  return;
}
void pp(int v, int kp) {
  for (int i = (int)adj[v].size() - 1; i >= 0; i--)
    if ((v == ind || adj[v][i].first != par[v]) and !p[v][i][kp])
      cout << adj[v][i].second + 1 << " ";
    else if (adj[v][i].first != par[v])
      pp(adj[v][i].first, p[v][i][kp]), kp -= p[v][i][kp];
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n - 1; i++)
    cin >> u >> v, u--, v--, adj[u].push_back(make_pair(v, i)),
        adj[v].push_back(make_pair(u, i));
  ans = INF;
  for (int i = 0; i < n; i++)
    for (int j = 0; j <= k; j++) dp[i][j] = INF;
  par[0] = -1, dfs(0), cout << ans << endl, pp(ind, k);
  return 0;
}
