#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = static_cast<ll>(1e9) + 7;
const int MAXN = static_cast<int>(1e6) + 17;
int n, k;
vector<int> g[MAXN];
int pr[MAXN][21];
int H[MAXN], used[MAXN];
bool read() {
  if (!(cin >> n >> k)) return false;
  for (ll i = 0; i < (ll)(n - 1); ++i) {
    int u, v;
    cin >> u >> v;
    g[u - 1].push_back(v - 1);
    g[v - 1].push_back(u - 1);
  }
  return true;
}
void dfs(int v, int p) {
  H[v] = H[p] + 1;
  pr[v][0] = p;
  for (int j = 1; j < 21; ++j) pr[v][j] = pr[pr[v][j - 1]][j - 1];
  for (auto to : g[v])
    if (to != p) dfs(to, v);
}
void solve() {
  dfs(n - 1, n - 1);
  k = n - k - 1;
  used[n - 1] = 1;
  for (int i = n - 1; i >= 0; --i) {
    if (used[i]) continue;
    int v = i;
    for (int j = 20; j >= 0; --j)
      if (!used[pr[v][j]]) v = pr[v][j];
    v = pr[v][0];
    if (H[i] - H[v] <= k) {
      k -= H[i] - H[v];
      for (v = i; !used[v]; v = pr[v][0]) used[v] = true;
    }
  }
  for (ll i = 0; i < (ll)(n); ++i)
    if (!used[i]) cout << i + 1 << ' ';
  cout << '\n';
}
int main() {
  cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::mt19937 rand('S' + 'E' + 'R' + 'E' + 'Z' + 'H' + 'K' + 'A');
  while (read()) solve();
  return 0;
}
