#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O2")
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << "=" << a << " # ";
  err(++it, args...);
}
using LL = long long;
using vi = vector<int>;
using pii = pair<int, int>;
const int N = 1e6 + 5, INF = 0x3f3f3f3f, MOD = 998244353;
vi g[N];
int n, k, ind, st[N], ed[N], a[N], fa[N], vis[N];
void add(int x, int y) {
  for (; x <= n; x += x & -x) a[x] += y;
}
void range_add(int l, int r, int k) { add(l, k), add(r + 1, -k); }
int ask(int x) {
  int res = 0;
  for (; x; x -= x & -x) res += a[x];
  return res;
}
void dfs(int x, int _fa, int _dep) {
  st[x] = ++ind;
  range_add(ind, ind, _dep);
  fa[x] = _fa;
  for (auto v : g[x])
    if (v != _fa) {
      dfs(v, x, _dep + 1);
    }
  ed[x] = ind;
}
int total;
void choose(int x) {
  for (int t = x; t != n; t = fa[t]) {
    if (vis[t]) break;
    total++;
    vis[t] = 1;
    range_add(st[t], ed[t], -1);
  }
}
void solve() {
  cin >> n >> k;
  for (int i = 2; i <= n; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v), g[v].push_back(u);
  }
  dfs(n, n, 0);
  vis[n] = 1;
  total++;
  for (int i = n - 1; i >= 1; i--) {
    if (ask(st[i]) + total > n - k) continue;
    choose(i);
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i]) cout << i << " ";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  solve();
  return 0;
}
