#include <bits/stdc++.h>
#pragma GCC optimize(3)
#pragma G++ optimize(3)
#pragma comment(linker, "/STACK: 20000000")
using namespace std;
struct IO {
  char buf[(1 << 20)], *p1, *p2;
  char pbuf[(1 << 20)], *pp;
  IO() : p1(buf), p2(buf), pp(pbuf) {}
  ~IO() { fwrite(pbuf, 1, pp - pbuf, stdout); }
  inline char gc() {
    if (p1 == p2) p2 = (p1 = buf) + fread(buf, 1, (1 << 20), stdin);
    return p1 == p2 ? ' ' : *p1++;
  }
  inline bool blank(char ch) {
    return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t';
  }
  template <class T>
  inline void read(T &x) {
    double tmp = 1;
    bool sign = 0;
    x = 0;
    char ch = gc();
    for (; !(ch >= '0' && ch <= '9'); ch = gc())
      if (ch == '-') sign = 1;
    for (; (ch >= '0' && ch <= '9'); ch = gc()) x = x * 10 + (ch - '0');
    if (ch == '.')
      for (ch = gc(); (ch >= '0' && ch <= '9'); ch = gc())
        tmp /= 10.0, x += tmp * (ch - '0');
    if (sign) x = -x;
  }
  inline void read(char *s) {
    char ch = gc();
    for (; blank(ch); ch = gc())
      ;
    for (; !blank(ch); ch = gc()) *s++ = ch;
    *s = 0;
  }
  inline void read(char &c) {
    for (c = gc(); blank(c); c = gc())
      ;
  }
  inline void push(const char &c) {
    if (pp - pbuf == (1 << 20)) fwrite(pbuf, 1, (1 << 20), stdout), pp = pbuf;
    *pp++ = c;
  }
  template <class T>
  inline void write(T x) {
    if (x < 0) x = -x, push('-');
    static T sta[35];
    T top = 0;
    do {
      sta[top++] = x % 10, x /= 10;
    } while (x);
    while (top) push(sta[--top] + '0');
  }
  template <class T>
  inline void write(T x, char lastChar) {
    write(x), push(lastChar);
  }
} io;
constexpr long long N = 1e6 + 5;
constexpr long long M = 998244353;
long long n, k;
vector<long long> g[N];
long long par[N][21];
long long d[N];
long long vis[N];
void dfs(long long u, long long p) {
  d[u] = d[p] + 1;
  par[u][0] = p;
  for (long long i = 1; i < 21; i++) par[u][i] = par[par[u][i - 1]][i - 1];
  for (long long v : g[u]) {
    if (v == p) continue;
    dfs(v, u);
  }
}
signed main() {
  io.read(n), io.read(k);
  for (long long i = 1; i <= n - 1; i++) {
    long long u, v;
    io.read(u), io.read(v);
    g[u].emplace_back(v);
    g[v].emplace_back(u);
  }
  dfs(n, 0);
  vis[0] = 1;
  vis[n] = 1;
  long long left = n - k - 1;
  for (long long i = n - 1; i >= 1; i--) {
    if (vis[i]) continue;
    long long u = i;
    long long dis = 0;
    for (long long j = 20; j >= 0; j--) {
      if (!vis[par[u][j]]) u = par[u][j], dis += 1 << j;
    }
    if (!vis[u]) dis++;
    if (dis > left) continue;
    left -= dis;
    for (long long p = i; !vis[p]; p = par[p][0]) vis[p] = 1;
  }
  for (long long i = 1; i <= n; i++) {
    if (!vis[i]) io.write(i, ' ');
  }
  io.push('\n');
  return 0;
}
