#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void in(register T& a) {
  register char c = getchar();
  register T x = 0, f = 1;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  a = x * f;
}
int n, k, tot, vis[2000003], now, pre, nex[2000003], to[2000003], head[2000003],
    cnt, ru[2000003], out[2000003], f[2000003], dep[2000003], tree[2000003];
inline void add(int u, int v) {
  to[++cnt] = v;
  nex[cnt] = head[u];
  head[u] = cnt;
}
inline void dfs(int u, int fa) {
  ru[u] = ++tot;
  f[u] = fa;
  for (register int i = head[u]; i; i = nex[i]) {
    int v = to[i];
    if (v == fa) continue;
    dep[v] = dep[u] + 1;
    dfs(v, u);
  }
  out[u] = tot;
}
inline int lowbit(int x) { return x & (-x); }
inline void add1(int l, int r) {
  int x = l;
  while (x <= tot) tree[x]++, x += lowbit(x);
  x = r + 1;
  while (x <= tot) tree[x]--, x += lowbit(x);
}
inline int sum(int pos) {
  int ans = 0;
  while (pos) ans += tree[pos], pos -= lowbit(pos);
  return ans;
}
int main() {
  in(n), in(k);
  k = n - k;
  int x, y;
  for (register int i = 1; i <= n - 1; i++) in(x), in(y), add(x, y), add(y, x);
  dep[n] = 1;
  dfs(n, n);
  add1(ru[n], out[n]);
  vis[n] = 1;
  now = n - 1;
  while (now >= 1) {
    if (vis[now]) {
      now--;
      continue;
    }
    int dis = dep[now] - sum(ru[now]) + 1;
    if (dis > k) {
      now--;
      continue;
    }
    pre = now;
    while (!vis[pre]) {
      add1(ru[pre], out[pre]);
      vis[pre] = 1;
      k--;
      pre = f[pre];
    }
    now--;
  }
  for (register int i = 1; i <= n - 1; i++)
    if (!vis[i]) printf("%d ", i);
  return 0;
}
