#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 1;
vector<int> g[N];
int n, k;
int dp[N][23];
bool visit[N];
void dfs(int u, int par) {
  for (int v : g[u]) {
    if (v != par) {
      dp[v][0] = u;
      dfs(v, u);
    }
  }
}
int f(int u, int K) {
  for (int i = 0; i <= 22; ++i) {
    if ((K & (1 << i))) {
      u = dp[u][i];
    }
  }
  return u;
}
int main() {
  std ::ios ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 1; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    g[x].emplace_back(y);
    g[y].emplace_back(x);
  }
  dp[n][0] = 0;
  dfs(n, -1);
  k = (n - k - 1);
  for (int i = 1; i <= 22; ++i) {
    for (int j = 1; j <= n; ++j) {
      dp[j][i] = dp[dp[j][i - 1]][i - 1];
    }
  }
  visit[0] = true;
  visit[n] = true;
  for (int i = n; i > 0; --i) {
    if (visit[f(i, k)]) {
      for (int u = i; !visit[u];) {
        --k;
        visit[u] = true;
        u = dp[u][0];
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (!visit[i]) {
      cout << i << ' ';
    }
  }
  cout << '\n';
  return 0;
}
