#include <bits/stdc++.h>
using namespace std;
const int LVL = 20;
vector<vector<long long int> > g((long long int)1000001);
int par[(long long int)1000001][LVL];
int dep[(long long int)1000001];
int done[(long long int)1000001];
void dfs(int v, int p) {
  for (auto i : g[v]) {
    if (i == p) continue;
    par[i][0] = v;
    dep[i] = dep[v] + 1;
    dfs(i, v);
  }
}
void pre(int n) {
  memset(par, (-1), sizeof(par));
  dfs(n - 1, -1);
  for (int level = 1; level < LVL; level++) {
    for (long long int v = 0; v < n; v++)
      if (~par[v][level - 1]) par[v][level] = par[par[v][level - 1]][level - 1];
  }
}
int lca(int u, int v) {
  if (dep[v] < dep[u]) swap(u, v);
  int diff = dep[v] - dep[u];
  for (long long int i = 0; i < LVL; i++)
    if (diff & (1 << i)) v = par[v][i];
  if (u == v) return u;
  for (int i = LVL - 1; i >= 0; i--) {
    if (par[u][i] != par[v][i]) v = par[v][i], u = par[u][i];
  }
  return par[u][0];
}
int can(int x) {
  int tmp = x;
  for (int i = LVL - 1; i >= 0; i--) {
    if (par[x][i] == -1) continue;
    if (!done[par[x][i]]) x = par[x][i];
  }
  return dep[tmp] - dep[x] + 1;
}
inline int dist(int u, int v) { return dep[u] + dep[v] - 2 * dep[lca(u, v)]; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  for (long long int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  pre(n);
  int afford = n - k;
  afford--;
  int ans = 0;
  done[n - 1] = 1;
  for (int points = n - 1; points >= 0; points--) {
    if (done[points]) {
      ans += points + 1;
      continue;
    }
    int dist = can(points);
    if (dist <= afford) {
      afford -= dist;
      int x = points;
      for (int i = 1; i <= dist; i++) {
        done[x] = 1;
        x = par[x][0];
      }
      ans += points + 1;
    }
  }
  for (long long int i = 0; i < n; i++)
    if (!done[i]) cout << i + 1 << " ";
}
