#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int n, m, tot, lnk[N], nxt[N << 1], son[N << 1];
int fa[N][21], dep[N];
int cnt;
bool sav[N];
void add(int x, int y) { nxt[++tot] = lnk[x], lnk[x] = tot, son[tot] = y; }
void dfs(int x, int p) {
  fa[x][0] = p, dep[x] = dep[p] + 1;
  for (int j = lnk[x]; j; j = nxt[j]) {
    if (son[j] == p) continue;
    dfs(son[j], x);
  }
}
void colorize(int x, int t) {
  if (x == t) return;
  sav[x] = 1, ++cnt;
  colorize(fa[x][0], t);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1, x, y; i < n; ++i) {
    scanf("%d%d", &x, &y);
    add(x, y), add(y, x);
  }
  dfs(n, 0);
  for (int j = 1; j <= 20; ++j) {
    for (int i = 1; i <= n; ++i) fa[i][j] = fa[fa[i][j - 1]][j - 1];
  }
  sav[n] = 1, cnt = 1;
  for (int i = n - 1, x; i; --i) {
    if (sav[i])
      continue;
    else
      x = i;
    for (int j = 20; ~j; --j) {
      if (fa[x][j] && dep[x] - dep[fa[x][j]] == (1 << j)) {
        if (!sav[fa[x][j]]) x = fa[x][j];
      }
    }
    x = fa[x][0];
    if (dep[i] - dep[x] + cnt <= n - m) colorize(i, x);
    if (cnt == n - m) break;
  }
  for (int i = 1; i <= n; ++i)
    ;
  for (int i = 1; i <= n; ++i)
    if (!sav[i]) printf("%d ", i);
  return 0;
}
