#include <bits/stdc++.h>
using namespace std;
vector<int> e[1000100];
int d[1000100], vis[1000100], dpt[1000100], sz[1000100], mx[1000100 * 8],
    ans[1000100], fa[1000100], t[1000100], inv[1000100], cnt;
void dfs(int x) {
  vis[x] = 1;
  sz[x] = 1;
  t[x] = cnt;
  inv[cnt] = x;
  cnt++;
  for (int i = 0; i < e[x].size(); i++) {
    int k = e[x][i];
    if (vis[k]) continue;
    dpt[k] = dpt[x] + 1;
    fa[k] = x;
    dfs(k);
    sz[x] += sz[k];
  }
}
void modify(int l, int r, int u, int v, int w, int id) {
  if (u <= l && r <= v) {
    mx[id] = max(mx[id], w);
    return;
  }
  int m = (l + r) / 2;
  if (u <= m) modify(l, m, u, min(v, m), w, id * 2);
  if (v > m) modify(m + 1, r, max(u, m + 1), v, w, id * 2 + 1);
}
int query(int l, int r, int x, int id) {
  if (l == r) return mx[id];
  int m = (l + r) / 2;
  if (x <= m) return max(query(l, m, x, id * 2), mx[id]);
  return max(query(m + 1, r, x, id * 2 + 1), mx[id]);
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    e[u].push_back(v);
    e[v].push_back(u);
    d[u]++;
    d[v]++;
  }
  k = n - k;
  dfs(n);
  ans[n] = 1;
  k--;
  for (int i = n - 1; i > 0; i--) {
    if (ans[i]) continue;
    int tmp = query(0, n, t[i], 1);
    if (dpt[i] - tmp <= k) {
      int x = i;
      while (!ans[x]) {
        ans[x] = 1;
        modify(0, n, t[x], t[x] + sz[x] - 1, dpt[x], 1);
        x = fa[x];
        k--;
      }
    }
  }
  for (int i = 1; i <= n; i++)
    if (!ans[i]) cout << i << " ";
  return 0;
}
