#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e6 + 10;
const double EPS = 1e-5;
const long long INF = 1e18 + 21;
const int MOD = 1e9 + 7;
const double pi = acos(-1);
int n, k, pr[30][MAXN], u, v, was[MAXN], used[MAXN], sz = 0, deep[MAXN], d = 0;
vector<int> graph[MAXN];
void dfs(int v) {
  was[v] = 1;
  deep[v] = d++;
  for (int i = 0; i < graph[v].size(); i++) {
    int to = graph[v][i];
    if (was[to] == 0) {
      pr[0][to] = v;
      dfs(to);
    }
  }
  d--;
}
int main() {
  cin >> n >> k;
  k = n - k;
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &u, &v);
    u--;
    v--;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  dfs(n - 1);
  pr[0][n - 1] = n - 1;
  for (int i = 1; i < 30; i++) {
    for (int j = 0; j < n; j++) {
      pr[i][j] = pr[i - 1][pr[i - 1][j]];
    }
  }
  used[n - 1] = 1;
  sz++;
  vector<int> ans;
  for (int i = n - 2; i > -1; i--) {
    if (used[i] == 0) {
      int j = 29;
      int now = i;
      for (; j > -1; j--) {
        if (used[pr[j][now]] == 0) {
          now = pr[j][now];
        }
      }
      if (sz + deep[i] - deep[now] < k) {
        int now = i;
        while (used[now] == 0) {
          sz++;
          used[now] = 1;
          now = pr[0][now];
        }
      } else {
        ans.push_back(i);
      }
    }
  }
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] + 1 << " ";
  }
  return 0;
}
