#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 7;
const int inf = (int)1e9 + 7;
int n, k;
vector<int> gr[N];
int h[N], used[N];
int lca[21][N];
void dfs(int v, int pr) {
  lca[0][v] = pr;
  for (int i = 1; i <= 20; i++) {
    lca[i][v] = lca[i - 1][lca[i - 1][v]];
  }
  for (int to : gr[v]) {
    if (to == pr) continue;
    h[to] = h[v] + 1;
    dfs(to, v);
  }
}
int getup(int v) {
  for (int i = 20; i >= 0; i--) {
    if (!used[lca[i][v]]) {
      v = lca[i][v];
    }
  }
  return lca[0][v];
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    gr[u].push_back(v);
    gr[v].push_back(u);
  }
  used[n] = 1;
  dfs(n, n);
  int cnt = 1;
  for (int i = n; i >= 1; i--) {
    if (used[i]) continue;
    int g = getup(i);
    if (h[i] - h[g] + cnt + k <= n) {
      int v = i;
      while (!used[v]) {
        used[v] = 1;
        v = lca[0][v];
        cnt++;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!used[i]) {
      cout << i << ' ';
    }
  }
}
