#include <bits/stdc++.h>
using namespace std;
constexpr int N = 1e6 + 10;
constexpr int LG = 21;
int n, u, v, limit, now, par[N], h[N], lg[N], dp[N][LG];
vector<int> node[N];
bool is[N];
void dfs(int v, int p = -1) {
  for (auto i : node[v]) {
    if (i != p) {
      h[i] = h[v] + 1;
      par[i] = v;
      dp[i][0] = v;
      dfs(i, v);
    }
  }
}
int who(int v, int l) {
  while (l) {
    v = dp[v][lg[l]];
    l -= (1 << lg[l]);
  }
  return v;
}
void paint(int x) {
  if (is[x]) return;
  is[x] = true;
  now--;
  paint(par[x]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> limit;
  for (int i = 0; i < n - 1; i++) {
    cin >> u >> v;
    node[u].push_back(v);
    node[v].push_back(u);
  }
  for (int i = 2; i < N; i++) lg[i] = lg[i >> 1] + 1;
  is[n] = true;
  dfs(n);
  now = n - 1;
  dp[n][0] = n;
  for (int i = 1; i < LG; i++)
    for (int j = 1; j <= n; j++) dp[j][i] = dp[dp[j][i - 1]][i - 1];
  for (int i = n - 1; i; i--) {
    if (is[i]) continue;
    if (is[who(i, now - limit)]) paint(i);
  }
  for (int i = 1; i <= n; i++)
    if (!is[i]) cout << i << ' ';
  cout << '\n';
  return 0;
}
