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;
const int N = 10005;
int n, fa[N], sz[N], bsz[N];
int pp, lnk[N], nxt[N * 2], to[N * 2];
bool ban[N];
set<pair<int, int> > S;
vector<pair<int, int> > ans;
void ae(int k1, int k2) { to[++pp] = k2, nxt[pp] = lnk[k1], lnk[k1] = pp; }
void push(int x, int y) {
  if (x == y) return;
  if (!S.count(minmax(x, y))) {
    S.insert(minmax(x, y));
    ans.push_back(minmax(x, y));
  }
}
void jb(int k1, int k2, int k3) {
  push(k1, k2);
  for (int i = lnk[k1]; i; i = nxt[i])
    if (to[i] != k3 && !ban[to[i]]) {
      jb(to[i], k2, k1);
    }
}
void sol(int k1) {
  vector<int> q;
  q.push_back(k1);
  for (int i = (0); i <= (((int)(q).size()) - 1); ++i) {
    int k1 = q[i];
    sz[k1] = 1, bsz[k1] = 0;
    for (int i = lnk[k1]; i; i = nxt[i])
      if (!ban[to[i]] && to[i] != fa[k1]) {
        fa[to[i]] = k1;
        q.push_back(to[i]);
      }
  }
  if (((int)(q).size()) <= 4) return;
  vector<int> cut;
  int B = min(((int)(q).size()), int(sqrt(((int)(q).size())) * 1.5));
  for (int i = (((int)(q).size()) - 1); i >= (0); --i) {
    int k1 = q[i];
    if (sz[k1] >= B || bsz[k1] > 1 || i == 0) {
      cut.push_back(k1);
      ban[k1] = 1;
      sz[k1] = 0;
      bsz[k1] = 1;
    }
    if (i) {
      sz[fa[k1]] += sz[k1];
      bsz[fa[k1]] += bsz[k1];
    }
  }
  for (int i = (0); i <= (((int)(cut).size()) - 1); ++i) {
    ban[cut[i]] = 1;
    for (int j = (i + 1); j <= (((int)(cut).size()) - 1); ++j) {
      push(cut[i], cut[j]);
    }
  }
  for (int i = (0); i <= (((int)(cut).size()) - 1); ++i) {
    jb(cut[i], cut[i], 0);
  }
  for (auto x : q)
    if (!ban[x]) sol(x);
}
int main() {
  scanf("%d%*d", &n);
  for (int i = (1); i <= (n - 1); ++i) {
    int k1, k2;
    scanf("%d%d", &k1, &k2);
    ae(k1, k2), ae(k2, k1);
    S.insert(minmax(k1, k2));
  }
  sol(1);
  printf("%d\n", ((int)(ans).size()));
  for (int i = (0); i <= (((int)(ans).size()) - 1); ++i)
    printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}