#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int n, kk, dp[N][21], dep[N];
bool vis[N];
vector<int> e[N], ans;
priority_queue<int, vector<int>, greater<int>> pq;
void dfs(int pos, int f) {
  dp[pos][0] = f;
  dep[pos] = dep[f] + 1;
  for (auto &i : e[pos])
    if (i != f) dfs(i, pos);
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> kk;
  int t1, t2;
  for (int i = 1; i < n; i++) {
    cin >> t1 >> t2;
    e[t1].push_back(t2);
    e[t2].push_back(t1);
  }
  dfs(n, 0);
  for (int j = 1; j <= 20; j++)
    for (int i = 1; i <= n; i++) dp[i][j] = dp[dp[i][j - 1]][j - 1];
  int cnt = n - kk - 1;
  vis[0] = vis[n] = 1;
  for (int i = n - 1; i > 0 && cnt; --i) {
    int cur = i;
    for (int j = 20; j >= 0; --j)
      if (!vis[dp[cur][j]]) cur = dp[cur][j];
    if (dep[i] - dep[cur] + 1 > cnt) continue;
    cur = i;
    while (!vis[cur]) vis[cur] = 1, cur = dp[cur][0];
    cnt -= dep[i] - dep[cur];
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i]) cout << i << ' ';
  return 0;
}
