#include <bits/stdc++.h>
using namespace std;
const long long INF = INT_MAX;
const long long MOD = 1e9 + 7;
int N, K;
vector<vector<pair<int, int> > > G;
long long size[410];
long long tmp[410];
vector<int> ans;
long long ansize = INF;
vector<vector<int> > dfs(int v, int par) {
  size[v] = 1;
  vector<vector<int> > ret(N + 1);
  vector<bool> flg(N + 1, false);
  for (pair<int, int> e : G[v])
    if (e.first != par) {
      vector<vector<int> > chiret = dfs(e.first, v);
      for (int k = size[v]; k > 0; k--) {
        for (int l = size[e.first]; l > 0; l--) {
          if (!flg[k + l] ||
              ret[k + l].size() > ret[k].size() + chiret[l].size()) {
            flg[k + l] = true;
            ret[k + l] = ret[k];
            for (long long i = 0; (i) < (chiret[l].size()); ++(i)) {
              ret[k + l].push_back(chiret[l][i]);
            }
          }
        }
        ret[k].push_back(e.second);
      }
      if (size[e.first] >= K && ansize > chiret[K].size() + 1) {
        ansize = chiret[K].size() + 1;
        ans = chiret[K];
        ans.push_back(e.second);
      }
      size[v] += size[e.first];
    }
  return ret;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N >> K;
  G.resize(N);
  for (long long i = 0; (i) < (N - 1); ++(i)) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    G[x].push_back({y, i + 1});
    G[y].push_back({x, i + 1});
  }
  vector<vector<int> > ret = dfs(0, -1);
  if (ansize > ret[K].size()) {
    ansize = ret[K].size();
    ans = ret[K];
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << endl;
  for (long long i = 0; (i) < (ans.size()); ++(i)) {
    cout << ans[i] << (i == ans.size() - 1 ? "\n" : " ");
  }
  return 0;
}
