#include <bits/stdc++.h>
using namespace std;
const int N = 1.1e6;
int hd[N], dep[N], fa[N][21], bl[N];
vector<int> vec[N], ans;
int find(int u) { return u == bl[u] ? u : bl[u] = find(bl[u]); }
void dfs(int u, int f, int d) {
  fa[u][0] = f, dep[u] = d;
  for (int i = 1; i <= 20; i++) fa[u][i] = fa[fa[u][i - 1]][i - 1];
  for (int v : vec[u])
    if (v != f) dfs(v, u, d + 1);
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1, u, v; i < n; i++) {
    cin >> u >> v;
    vec[u].push_back(v);
    vec[v].push_back(u);
  }
  dfs(n, 0, 1);
  for (int i = 1; i <= n; i++) bl[i] = i;
  k = n - k - 1;
  for (int i = n - 1; i; i--) {
    if (find(i) == n) continue;
    int u = i;
    for (int j = 20; ~j; j--)
      if (fa[u][j] && find(fa[u][j]) != n) u = fa[u][j];
    if (dep[i] - dep[u] + 1 <= k) {
      k -= dep[i] - dep[u] + 1;
      while (find(i) != n) bl[find(i)] = fa[find(i)][0];
    } else
      ans.push_back(i);
  }
  reverse(ans.begin(), ans.end());
  for (int i : ans) cout << i << ' ';
  return 0;
}
