#include <bits/stdc++.h>
using namespace std;
int good[1000006];
int lca[20][1000006], level[1000006];
vector<int> X[1000006];
void dfs(int i, int par, int lvl) {
  level[i] = lvl;
  lca[0][i] = par;
  for (int j = 0; j < X[i].size(); j++)
    if (X[i][j] != par) dfs(X[i][j], i, lvl + 1);
}
int countNodes(int i) {
  int x = i;
  for (int j = 19; j >= 0; j--)
    if (level[lca[j][i]] >= 1 && good[lca[j][i]] == 0) i = lca[j][i];
  return level[x] - level[i] + 1;
}
void markNodes(int i) {
  while (!good[i]) {
    good[i] = 1;
    if (lca[0][i]) i = lca[0][i];
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
  int N, K;
  cin >> N >> K;
  for (int i = 1; i <= N - 1; i++) {
    int x, y;
    cin >> x >> y;
    X[x].push_back(y);
    X[y].push_back(x);
  }
  dfs(N, 0, 1);
  for (int i = 1; i <= 19; i++)
    for (int j = 1; j <= N; j++) lca[i][j] = lca[i - 1][lca[i - 1][j]];
  int grpSize = 1;
  good[N] = 1;
  for (int i = N - 1; i >= 1; i--) {
    if (good[i]) continue;
    int x = countNodes(i);
    if (x + grpSize > N - K) continue;
    markNodes(i);
    grpSize += x;
  }
  for (int i = 1; i <= N; i++)
    if (!good[i]) cout << i << " ";
  cout << "\n";
  return 0;
}
