Problem: As you may already know, Dušan is keen on playing with railway models. He has a big map with cities that are connected with railways. His map can be seen as a graph where vertices are cities and the railways connecting them are the edges. So far, the graph corresponding to his map is a tree. As you already know, a tree is a connected acyclic undirected graph.

He is curious to find out whether his railway can be optimized somehow. He wants to add so-called shortcuts, which are also railways connecting pairs of cities. This shortcut will represent the railways in the unique path in the tree between the pair of cities it connects. Since Dušan doesn't like repeating the railways, he has also defined good paths in his newly obtained network (notice that after adding the shortcuts, his graph is no more a tree). He calls a path good, if no edge appears more than once, either as a regular railway edge or as an edge represented by some shortcut (Every shortcut in a good path has length 1, but uses up all the edges it represents - they can't appear again in that path). Having defined good paths, he defines good distance between two cities to be the length of the shortest good path between them. Finally, the shortcutting diameter of his network is the largest good distance between any two cities.

Now he is curious to find out whether it is possible to achieve shortcutting diameter less or equal than k, while adding as few shortcuts as possible.

Your solution should add no more than 10 ⋅ n shortcuts.

Input

The first line in the standard input contains an integer n (1 ≤ n ≤ 10^4), representing the number of the cities in Dušan's railway map, and an integer k (3 ≤ k ≤ n) representing the shortcutting diameter that he wants to achieve.

Each of the following n - 1 lines will contain two integers u_i and v_i (1 ≤ u_i, v_i ≤ n, u_i ≠ v_i), meaning that there is a railway between cities u_i and v_i.

Output

The first line of the output should contain a number t representing the number of the shortcuts that were added.

Each of the following t lines should contain two integers u_i and v_i, signifying that a shortcut is added between cities u_i and v_i.

Example

Input


10 3
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10


Output


8
3 7
3 5
3 6
3 1
7 9
7 10
7 4
7 5

Note

Notice that adding a shortcut between all cities and city 1 will make a graph theoretic diameter become 2. On the other hand, the paths obtained that way might not be good, since some of the edges might get duplicated. In the example, adding a shortcut between all cities and city 1 doesn't create a valid solution, because for cities 5 and 10 the path that uses shortcuts 5-1 and 1-10 is not valid because it uses edges 1-2, 2-3, 3-4, 4-5 twice.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
template <typename T>
using pair2 = pair<T, T>;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) { return (ull)rng() % B; }
clock_t startTime;
double getCurrentTime() {
  return (double)(clock() - startTime) / CLOCKS_PER_SEC;
}
const int N = 10010;
int n;
vector<int> g[N];
int sz[N];
bool bad[N];
vector<pii> ans;
void dfsSz(int v, int par) {
  sz[v] = 1;
  for (int u : g[v]) {
    if (u == par || bad[u]) continue;
    dfsSz(u, v);
    sz[v] += sz[u];
  }
}
int getCentr(int v) {
  dfsSz(v, -1);
  int S = sz[v];
  while (true) {
    int w = v;
    for (int u : g[v]) {
      if (bad[u]) continue;
      if (sz[u] > sz[v]) continue;
      if (2 * sz[u] >= S) {
        w = u;
      }
    }
    if (w == v) break;
    v = w;
  }
  return v;
}
void addEdges(int v, int par, int to) {
  ans.push_back(make_pair(v, to));
  for (int u : g[v]) {
    if (bad[u] || u == par) continue;
    addEdges(u, v, to);
  }
}
int solve(int v, int oldc, int oldv) {
  v = getCentr(v);
  dfsSz(v, -1);
  vector<pii> sons;
  for (int u : g[v]) {
    if (bad[u]) continue;
    sons.push_back(make_pair(sz[u], u));
  }
  bad[v] = 1;
  if (oldc != -1) {
    addEdges(oldv, oldc, oldc);
    ans.push_back(make_pair(v, oldc));
  }
  sort((sons).begin(), (sons).end());
  reverse((sons).begin(), (sons).end());
  for (int i = 0; i < (int)sons.size(); i++) {
    int u = sons[i].second;
    if (i == 0 && oldc == -1) {
      solve(u, v, u);
    } else {
      addEdges(u, v, v);
      solve(u, -1, -1);
    }
  }
  return v;
}
int main() {
  startTime = clock();
  int k;
  scanf("%d%d", &n, &k);
  set<pii> hv;
  for (int i = 1; i < n; i++) {
    int v, u;
    scanf("%d%d", &v, &u);
    v--;
    u--;
    hv.insert(make_pair(v, u));
    hv.insert(make_pair(u, v));
    g[v].push_back(u);
    g[u].push_back(v);
  }
  solve(1, -1, -1);
  vector<pii> nans;
  for (pii t : ans)
    if (hv.count(t) == 0) nans.push_back(t);
  if ((int)nans.size() > 10 * n) throw;
  printf("%d\n", (int)nans.size());
  for (pii t : nans) {
    printf("%d %d\n", t.first + 1, t.second + 1);
  }
  return 0;
}