#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 20;
const int M = 1e9 + 7;
const double eps = 1e-6;
const double PI(acos(-1.0));
int n, k;
vector<int> g[N];
int f[N][20];
int d[N];
void dfs(int u, int p, int dep) {
  f[u][0] = p;
  d[u] = dep;
  for (auto v : g[u])
    if (v - p) dfs(v, u, dep + 1);
}
int in[N];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < (n - 1); i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(n, n, 0);
  for (int j = 1; j < 20; j++) {
    for (int i = 1; i <= n; i++) f[i][j] = f[f[i][j - 1]][j - 1];
  }
  k = n - k;
  in[n] = 1;
  k--;
  for (int i = n - 1; i; i--) {
    if (in[i]) continue;
    if (k <= 0) break;
    int u = i;
    for (int j = 19; ~j; j--) {
      if (!in[f[u][j]]) u = f[u][j];
    }
    if (d[i] - d[u] + 1 <= k) {
      u = i;
      while (!in[u]) {
        in[u] = 1;
        k--;
        u = f[u][0];
      }
    }
  }
  vector<int> ans;
  for (int i = (1); i <= (n); i++)
    if (!in[i]) ans.push_back(i);
  for (auto x : ans) cout << x << " ";
}
