#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 9;
const int INF = 1e9;
bool t[N << 2];
void upd(const int& v, const int& tl, const int& tr, const int& pos) {
  t[v] |= 1;
  if (tl == tr) return;
  int tm = (tl + tr) >> 1;
  if (pos <= tm)
    upd(v << 1, tl, tm, pos);
  else
    upd(v << 1 | 1, tm + 1, tr, pos);
}
int get2(const int& v, const int& tl, const int& tr) {
  if (tl == tr) return tl;
  int tm = (tl + tr) >> 1;
  if (t[v << 1]) return get2(v << 1, tl, tm);
  return get2(v << 1 | 1, tm + 1, tr);
}
int get(const int& v, const int& tl, const int& tr, const int& l) {
  if (l > tr || !t[v]) return INF;
  if (tl == l) return get2(v, tl, tr);
  int tm = (tl + tr) >> 1;
  int ret = get(v << 1, tl, tm, l);
  if (ret != INF) return ret;
  return get(v << 1 | 1, tm + 1, tr, max(l, tm + 1));
}
int way[N];
bool have[N];
int ind[N];
int st[N];
int fin[N];
int cnt[N];
vector<int> _g[N], g[N];
int parent[N];
int n, k;
void cnt_dfs(int v, int par) {
  cnt[v] = 1;
  for (int to : _g[v])
    if (to != par) {
      cnt_dfs(to, v);
      cnt[v] += cnt[to];
      parent[to] = v;
      g[v].push_back(to);
    }
  if (!g[v].size()) return;
  int ind = 0;
  for (int i = 0; i < (int)g[v].size(); ++i)
    if (cnt[g[v][i]] > cnt[g[v][ind]]) ind = i;
  swap(g[v][ind], g[v][0]);
}
int vcnt = 0;
int wcnt = 1;
char used[N];
bool dead[N];
void go(int v, int wind, bool first) {
  way[v] = wind;
  ind[v] = vcnt++;
  used[v] = 1;
  if (first) st[wind] = v;
  if (v == n || used[parent[v]])
    fin[wind] = v;
  else
    go(parent[v], wind, 0);
}
void build_hld(int v) {
  for (int to : g[v]) build_hld(to);
  if (!g[v].size()) go(v, wcnt++, 1);
}
int get(int v) {
  int wind = way[v];
  if (have[wind]) return get(1, 0, n, ind[v]) - ind[v];
  return ind[fin[wind]] - ind[v] + 1 + get(parent[fin[wind]]);
}
void up(int v) {
  if (dead[v]) return;
  dead[v] = 1;
  have[way[v]] |= 1;
  upd(1, 0, n, ind[v]);
  up(parent[v]);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    _g[u].push_back(v);
    _g[v].push_back(u);
  }
  cnt_dfs(n, -1);
  build_hld(n);
  have[way[n]] = 1;
  dead[n] = 1;
  upd(1, 0, n, ind[n]);
  int t = n - k - 1;
  for (int i = n - 1; t; --i) {
    int cur = get(i);
    if (cur > t) continue;
    t -= cur;
    up(i);
  }
  for (int i = 1; i <= n; ++i)
    if (!dead[i]) cout << i << " ";
  return 0;
}
