#include <bits/stdc++.h>
using namespace std;
const int logsize = 20;
bool vis[1000005];
int n, k, cnt, r, dep[1000005], pr[1000005][logsize + 5];
vector<int> g[1000005];
void dfs(int u, int p) {
  pr[u][0] = p;
  dep[u] = p == -1 ? 0 : (dep[p] + 1);
  for (int v : g[u]) {
    if (v == p) continue;
    dfs(v, u);
  }
}
int find(int u) {
  int res = 0;
  for (int i = logsize; i >= 0; --i) {
    if (!vis[pr[u][i]]) {
      u = pr[u][i];
      res |= (1 << i);
    }
  }
  return res + 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> k;
  r = n - k;
  for (int i = 1; i <= n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(n, 0);
  for (int i = 1; i <= logsize - 1; ++i) {
    for (int u = 1; u <= n; ++u) {
      pr[u][i] = pr[pr[u][i - 1]][i - 1];
    }
  }
  vis[0] = 1;
  for (int u = n; u >= 1; --u) {
    if (vis[u]) continue;
    int dis = find(u);
    if (dis + cnt > r) continue;
    cnt += dis;
    for (int v = u; !vis[v]; v = pr[v][0]) {
      vis[v] = 1;
    }
  }
  for (int u = 1; u <= n; ++u) {
    if (vis[u]) continue;
    cout << u << ' ';
  }
  cout << endl;
}
