#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000200;
const int maxh = 21;
int p[maxn], d[maxn];
vector<int> g[maxn];
bool vis[maxn];
int gpa[maxn][maxh];
int n, k;
inline void build() {
  for (int i = 1; i <= n; ++i) gpa[i][0] = p[i];
  for (int k = 1; (1 << k) <= n; ++k)
    for (int i = 1; i <= n; ++i)
      if (d[i] >= (1 << k)) gpa[i][k] = gpa[gpa[i][k - 1]][k - 1];
}
inline int get_gpa(int u, int h) {
  for (int i = 0; h > 0; h >>= 1, ++i)
    if (h & 1) u = gpa[u][i];
  if (u == 0) return n;
  return u;
}
inline void dfs(int u, int fa) {
  p[u] = fa;
  for (auto v : g[u]) {
    if (v == fa) continue;
    d[v] = d[u] + 1;
    dfs(v, u);
  }
}
int main() {
  int u, v;
  scanf("%d %d", &n, &k);
  for (int i = 1; i < n; ++i) {
    scanf("%d %d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(n, 0);
  build();
  int lft = n - k - 1;
  vis[n] = true;
  for (int i = n - 1; i; --i) {
    int v = get_gpa(i, lft);
    if (vis[v]) {
      int t = i;
      while (!vis[t]) {
        vis[t] = true;
        --lft;
        t = p[t];
      }
    }
  }
  bool first = true;
  for (int i = 1; i <= n; ++i) {
    if (vis[i]) continue;
    if (!first) printf(" ");
    first = false;
    printf("%d", i);
  }
  return 0;
}
