#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1000 * 1000 + 10;
const int MAX_K = 20 + 5;
vector<int> adj[MAX_N];
int par[MAX_N][MAX_K];
bool block[MAX_N];
bool mark[MAX_N];
void dfs(int u, int dad) {
  par[u][0] = u;
  for (int i = 1; i < MAX_K; i++) par[u][i] = par[par[dad][i - 1]][i - 1];
  for (auto v : adj[u])
    if (v != dad) dfs(v, u);
}
void add(int u) {
  mark[u] = true;
  if (!mark[par[u][1]]) add(par[u][1]);
}
void rem(int u) {
  block[u] = true;
  for (auto v : adj[u])
    if (v != par[u][1] && !block[v]) rem(v);
}
int dis(int u) {
  int L = 0, R = 20;
  while (L + 1 < R) {
    int mid = (L + R) / 2;
    mark[par[u][mid]] ? R = mid : L = mid;
  }
  return (L ? dis(par[u][L]) : 1) + (1 << L) - 1;
}
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n, k;
  cin >> n >> k;
  k = n - k - 1;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(n - 1, n - 1), add(n - 1);
  for (int i = n - 2; ~i && k; i--)
    if (!block[i] && !mark[i]) {
      int x = dis(i);
      x <= k ? k -= x, add(i) : rem(i);
    }
  for (int i = 0; i < n; i++)
    if (!mark[i]) cout << i + 1 << ' ';
  return 0;
}
