#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long inf2 = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-6;
const int mod = 1000000007;
namespace fastio {
char in[100000];
int itr = 0, llen = 0;
char get() {
  if (itr == llen) llen = fread(in, 1, 100000, stdin), itr = 0;
  if (llen == 0) return EOF;
  return in[itr++];
}
char out[100000];
int itr2 = 0;
void put(char c) {
  out[itr2++] = c;
  if (itr2 == 100000) {
    fwrite(out, 1, 100000, stdout);
    itr2 = 0;
  }
}
int clear() {
  fwrite(out, 1, itr2, stdout);
  itr2 = 0;
  return 0;
}
int getint() {
  int r = 0;
  bool ng = 0;
  char c;
  c = get();
  while (c != '-' && (c < '0' || c > '9')) c = get();
  if (c == '-') ng = 1, c = get();
  while (c >= '0' && c <= '9') r = r * 10 + c - '0', c = get();
  return ng ? -r : r;
}
string getstr() {
  string ret = "";
  char ch = get();
  while (ch == ' ' || ch == '\n') ch = get();
  while (ch != ' ' && ch != '\n') ret.push_back(ch), ch = get();
  return ret;
}
void putstr(string s) {
  for (int i = 0; i < s.size(); i++) put(s[i]);
}
void putint(int x) {
  if (x < 0) {
    put('-');
    x = -x;
  }
  if (x == 0) {
    put('0');
    return;
  }
  char c[20];
  int pos = 0;
  while (x) {
    c[pos++] = '0' + x % 10;
    x /= 10;
  }
  for (int i = pos - 1; i >= 0; i--) put(c[i]);
}
void getarr(int arrname[], int size) {
  for (int i = 0; i < size; i++) arrname[i] = getint();
}
}  // namespace fastio
using namespace fastio;
int n, k;
vector<int> g[1000005];
int par[22][1000005];
int depth[1000005];
int used[1000005];
int getdist(int x) {
  if (used[x]) return 0;
  int cnt = 0;
  for (int i = 21; i >= 0; i--)
    if (par[i][x] != -1 && !used[par[i][x]]) cnt += (1 << i), x = par[i][x];
  cnt++;
  return cnt;
}
void init() {
  for (int i = 1; i < 22; i++) {
    for (int j = 1; j <= n; j++) {
      if (par[i - 1][j] == -1)
        par[i][j] = -1;
      else
        par[i][j] = par[i - 1][par[i - 1][j]];
    }
  }
}
void dfs(int x, int pr, int dep) {
  par[0][x] = pr;
  depth[x] = dep;
  for (auto to : g[x])
    if (to != pr) dfs(to, x, dep + 1);
}
int main() {
  n = getint();
  k = getint();
  for (int i = 1; i < n; i++) {
    int a = getint(), b = getint();
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(n, -1, 0);
  init();
  used[n] = true;
  used[0] = true;
  int rest = n - k - 1;
  for (int i = n - 1; i >= 1 && rest; i--) {
    if (getdist(i) <= rest) {
      int cur = i;
      while (!used[cur]) {
        rest--;
        used[cur] = true;
        cur = par[0][cur];
      }
    }
  }
  for (int i = 1; i <= n; i++)
    if (!used[i]) putint(i), put(' ');
  clear();
  return 0;
}
