#include <bits/stdc++.h>
using namespace std;
const int N = 1.1e6, M = 25;
vector<int> edge[N];
int p[M][N];
bool visit[N];
void init(int n) {
  bool v[N];
  function<void(int, int)> dfs;
  dfs = [&](int s, int ps) {
    p[0][s] = ps;
    v[s] = true;
    for (auto t : edge[s])
      if (!v[t]) dfs(t, s);
  };
  fill(v, v + n, false);
  v[n] = true;
  dfs(n, n);
  for (int i = 1; i < M; i++)
    for (int j = 1; j < n; j++) p[i][j] = p[i - 1][p[i - 1][j]];
  visit[0] = true;
}
int query(int s) {
  int rtn = 0;
  for (int i = M - 1; i >= 0; i--) {
    if (!visit[p[i][s]]) {
      s = p[i][s];
      rtn += 1 << i;
    }
  }
  if (!visit[s]) rtn++;
  return rtn;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k, r;
  cin >> n >> k;
  r = n - k;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }
  init(n);
  visit[n] = true;
  r--;
  for (int i = n - 1; i > 0; i--) {
    int q = query(i);
    if (q <= r) {
      for (int j = 0, c = i; j < q; j++, c = p[0][c]) visit[c] = true;
      r -= q;
    }
  }
  for (int i = 1; i <= n; i++)
    if (!visit[i]) cout << i << " ";
  cout << endl;
  return 0;
}
