#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const double eps = 1e-6;
const int N = 1e6 + 10;
bool vis[N];
bool chose[N];
struct Edge {
  int to, next;
} edge[N << 1];
int head[N];
int cnt = 0;
void add(int u, int v) {
  edge[cnt].to = v;
  edge[cnt].next = head[u];
  head[u] = cnt++;
}
int fa[N][22];
int facnt[N];
int dep[N];
void dfs(int u, int f) {
  if (vis[u]) return;
  vis[u] = true;
  if (f != u) {
    dep[u] = dep[f] + 1;
    fa[u][0] = f;
    facnt[u] = 1;
    for (int i = 1;; ++i) {
      if (facnt[fa[u][i - 1]] > i - 1) {
        fa[u][i] = fa[fa[u][i - 1]][i - 1];
        facnt[u]++;
      } else {
        break;
      }
    }
  }
  for (int i = head[u]; ~i; i = edge[i].next) {
    int v = edge[i].to;
    if (!vis[v]) {
      dfs(v, u);
    }
  }
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  memset(head, -1, sizeof(head));
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
  }
  facnt[n] = 0;
  dep[n] = 0;
  dfs(n, n);
  chose[n] = true;
  int c = n - k - 1;
  for (int i = n - 1; i >= 1; --i) {
    if (!c) break;
    if (chose[i]) continue;
    int u = i;
    while (!chose[fa[u][0]]) {
      int l = 0, r = facnt[u];
      while (r - l > 1) {
        int mid = (l + r) >> 1;
        if (chose[fa[u][mid]]) {
          r = mid;
        } else {
          l = mid;
        }
      }
      u = fa[u][l];
    }
    int x = dep[i] - dep[u] + 1;
    if (x <= c) {
      c -= x;
      u = i;
      for (int j = 0; j < x; ++j) {
        chose[u] = true;
        u = fa[u][0];
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (!chose[i]) {
      printf("%d ", i);
    }
  }
  return 0;
}
