#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> up, g;
vector<bool> included;
vector<int> tw(21);
void dfs(int v, int p) {
  up[v][0] = p;
  for (int i = 1; i < 21 && up[v][i - 1] != -1; i++) {
    up[v][i] = up[up[v][i - 1]][i - 1];
  }
  for (int i : g[v]) {
    if (i != p) {
      dfs(i, v);
    }
  }
}
int find(int v) {
  int cnt = 0;
  for (int i = 20; i >= 0; i--) {
    if (up[v][i] != -1 && !included[up[v][i]]) {
      cnt += tw[i];
      v = up[v][i];
    }
  }
  return cnt + 1;
}
void go(int v) {
  while (!included[v]) {
    included[v] = true;
    v = up[v][0];
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  g.resize(n);
  included.resize(n);
  for (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);
  }
  tw[0] = 1;
  for (int i = 1; i < 21; i++) {
    tw[i] = 2 * tw[i - 1];
  }
  up.resize(n, vector<int>(21, -1));
  dfs(n - 1, -1);
  included[n - 1] = true;
  int curam = 1;
  for (int i = n - 2; i >= 0; i--) {
    if (!included[i]) {
      int am = find(i);
      if (am <= (n - k) - curam) {
        go(i);
        curam += am;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (!included[i]) {
      cout << i + 1 << " ";
    }
  }
  return 0;
}
