#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010;
const long long mod = 1e9 + 7;
const long long INF = 100000000000000LL;
const double PI = acos(-1.0);
typedef struct EDGE {
  int v;
  int next;
} Edge;
Edge edge[maxn * 2];
int head[maxn], cnt;
inline void add(int u, int v) {
  edge[cnt].v = v;
  edge[cnt].next = head[u];
  head[u] = cnt++;
}
vector<int> v[maxn];
vector<int> num[maxn];
int f[maxn];
int nd[maxn];
int ans;
int vis[maxn];
int n, k;
void dfs_init(int u, int pos, int fa) {
  f[u] = fa;
  int temp = pos;
  while (temp) {
    v[u].push_back(nd[pos - temp + 1]);
    num[u].push_back(temp);
    if (temp > 1 && temp < 6)
      temp = 1;
    else
      temp /= 6;
  }
  nd[pos + 1] = u;
  for (int i = head[u]; i != -1; i = edge[i].next) {
    int v = edge[i].v;
    if (v == fa) continue;
    dfs_init(v, pos + 1, u);
  }
}
int Count(int u) {
  for (int i = 1; i <= v[u].size() - 1; ++i) {
    if (!vis[v[u][i]]) {
      if (num[u][i] + ans > n - k) return num[u][i];
      return num[u][i] + Count(v[u][i]);
    }
  }
  return 1;
}
int solve() {
  cnt = 0;
  memset(head, -1, sizeof(head));
  memset(vis, 0, sizeof(vis));
  ans = 1;
  cin >> n >> k;
  vis[n] = 1;
  for (int i = 1; i <= n - 1; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    add(u, v);
    add(v, u);
  }
  dfs_init(n, 0, 0);
  for (int i = n; i >= 1 && ans < n - k; i--) {
    if (vis[i]) continue;
    int tcnt = Count(i);
    if (tcnt + ans <= n - k) {
      ans += tcnt;
      int tp = i;
      while (!vis[tp]) vis[tp] = 1, tp = f[tp];
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (!vis[i]) printf("%d ", i);
  }
  cout << endl;
  return 0;
}
int main() {
  long long t = 1e18;
  while (t--) {
    if (!solve()) break;
  }
  int mark_EOF;
  if (scanf("%d", &mark_EOF) == EOF) return 0;
  return 0;
}
