#include <bits/stdc++.h>
using namespace std;
using ll = long long;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int N = 1e6 + 10;
int fa[N], p[N][21], cnt, head[N], vis[N];
struct Edge {
  int v, next;
} e[N << 1];
inline void add(int u, int v) {
  e[++cnt].v = v;
  e[cnt].next = head[u];
  head[u] = cnt;
}
inline void dfs(int u, int Fa) {
  fa[u] = Fa;
  p[u][0] = Fa;
  for (int i = 1; i <= 20; i++) p[u][i] = p[p[u][i - 1]][i - 1];
  for (int i = head[u]; i; i = e[i].next) {
    int v = e[i].v;
    if (v == Fa) continue;
    dfs(v, u);
  }
  return;
}
int main() {
  int n = read(), k = read();
  int res = n - k;
  for (int i = 1; i < n; i++) {
    int u = read(), v = read();
    add(u, v);
    add(v, u);
  }
  dfs(n, n);
  res--;
  vis[n] = 1;
  for (int i = n - 1; i >= 1; i--) {
    if (vis[i]) continue;
    int len = 1, v = i;
    for (int j = 20; j >= 0; j--)
      if (!vis[p[v][j]]) {
        v = p[v][j];
        len += (1 << j);
      }
    if (len <= res) {
      res -= len;
      int ff = i;
      while (1) {
        if (vis[ff]) break;
        vis[ff] = 1;
        ff = fa[ff];
      }
    }
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i]) printf("%d ", i);
  return 0;
}
