#include <bits/stdc++.h>
#pragma warning(disable : 4018)
using namespace std;
const int Inf = (int)1e9 + 7;
namespace {
const int N = (int)1e6 + 7;
int n;
vector<int> gr[N];
vector<int> tr[N];
int anc[N][21];
int dep[N], tt, tin[N], tout[N];
void dfs(int a, int p) {
  tt++;
  tin[a] = tt;
  anc[a][0] = (p == 0 ? n : p);
  for (int b : gr[a])
    if (b != p) {
      tr[a].push_back(b);
      dep[b] = dep[a] + 1;
      dfs(b, a);
    }
  tout[a] = tt;
}
void solve() {
  int k;
  cin >> n >> k;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    gr[a].push_back(b);
    gr[b].push_back(a);
  }
  tt = 0;
  dep[n] = 1;
  dfs(n, 0);
  for (int l = 0; l < 20; l++) {
    for (int a = 1; a <= n; a++) {
      anc[a][l + 1] = anc[anc[a][l]][l];
    }
  }
  vector<int> keep;
  vector<int> used(n + 1, 0);
  keep.push_back(n);
  used[n] = 1;
  for (int a = n - 1; a >= 1; a--) {
    if (used[a]) continue;
    int b = a;
    for (int i = 20; i >= 0; i--)
      if (used[anc[b][i]] == 0) b = anc[b][i];
    b = anc[b][0];
    int cnt = dep[a] - dep[b];
    if (keep.size() + cnt + k <= n) {
      for (int x = a; x != b;) {
        used[x] = 1;
        keep.push_back(x);
        x = anc[x][0];
      }
    }
  }
  for (int i = 1; i <= n; i++)
    if (!used[i]) cout << i << " ";
  cout << "\n";
}
}  // namespace
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(9);
  cout << fixed;
  solve();
  return 0;
}
