#include <bits/stdc++.h>
using namespace std;
const int N = 405;
int n, k, dp[N][N], size_tree[N][N], edge_id[N][N], copy_dp[N], _par[N];
bool ok[N];
vector<int> adj[N];
void dfs(int u, int par = -1) {
  ;
  dp[u][0] = 0;
  dp[u][1] = adj[u].size();
  _par[u] = par;
  for (int i = 2; i <= k; i++) dp[u][i] = N;
  for (auto v : adj[u]) {
    if (v != par) {
      dfs(v, u);
      for (int i = 0; i <= k; i++) copy_dp[i] = dp[u][i];
      for (int i = 2; i <= k; i++)
        for (int j = 1; j < i; j++) {
          int t = dp[v][i - j] + copy_dp[j] - 2;
          if (dp[u][i] > t) {
            dp[u][i] = t;
            size_tree[v][i] = i - j;
          }
        }
    }
  }
}
void find_del_edge(int u, int par, int size) {
  ok[u] = true;
  for (auto v : adj[u]) {
    if (v != par) {
      if (size_tree[v][size]) {
        find_del_edge(v, u, size_tree[v][size]);
        size -= size_tree[v][size];
      }
    }
  }
}
int main() {
  cin >> n >> k;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
    edge_id[min(u, v)][max(u, v)] = i;
  }
  dfs(0);
  int root = -1, res = N;
  for (int i = 0; i < n; i++) {
    reverse(adj[i].begin(), adj[i].end());
    if (res >= dp[i][k]) {
      root = i;
      res = dp[i][k];
    }
  }
  cout << res << "\n";
  find_del_edge(root, _par[root], k);
  for (int i = 0; i < n; i++)
    if (!ok[i])
      for (auto v : adj[i])
        if (ok[v]) cout << edge_id[min(v, i)][max(v, i)] << " ";
}
