#include <bits/stdc++.h>
const int MAXN = 1e6 + 5;
std::vector<int> G[MAXN];
int f[MAXN][26];
void dfs(int v) {
  for (register int i = 1; i <= 20; ++i) {
    f[v][i] = f[f[v][i - 1]][i - 1];
  }
  for (auto x : G[v]) {
    if (x == f[v][0]) continue;
    f[x][0] = v;
    dfs(x);
  }
}
int n, k;
bool vis[MAXN];
int main() {
  scanf("%d%d", &n, &k);
  for (register int i = 1; i <= n - 1; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  int res = n - k;
  f[n][0] = n;
  dfs(n);
  vis[n] = true;
  res--;
  for (register int i = n - 1; i >= 1; --i) {
    if (vis[i]) continue;
    int len = 1, v = i;
    for (register int j = 20; j >= 0; --j) {
      if (vis[f[v][j]]) continue;
      v = f[v][j];
      len += (1 << j);
    }
    if (len <= res) {
      res -= len;
      int x = i;
      while (true) {
        if (vis[x]) break;
        vis[x] = 1;
        x = f[x][0];
      }
    }
  }
  for (register int i = 1; i <= n; ++i)
    if (!vis[i]) printf("%d ", i);
  puts("");
  return 0;
}
