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;
struct Node {
  vector<int> nb;
  bool isCutVertex = false;
  int parent = -1;
  int cutVertexLevel;
  int subtreeSize;
};
int n, a, b, k;
map<pair<int, int>, bool> edges;
Node vertex[100005];
vector<int> treesToCut;
vector<pair<int, int>> extraEdges;
int visited[100005] = {0};
int cut(int root, int level, int treeSize, bool isFirstInLevel) {
  visited[root] = level;
  int totalSubtreeSize = 0;
  for (int nb : vertex[root].nb) {
    if (!vertex[nb].isCutVertex && visited[nb] < level) {
      vertex[nb].parent = root;
      visited[nb] = level;
      totalSubtreeSize += cut(nb, level, treeSize, false);
    }
  }
  totalSubtreeSize += 1;
  if (totalSubtreeSize >= sqrt(treeSize) && treeSize > k) {
    vertex[root].isCutVertex = true;
    vertex[root].cutVertexLevel = level;
    for (int nb : vertex[root].nb) {
      if (!vertex[nb].isCutVertex && vertex[root].parent != nb) {
        cut(nb, level + 1, vertex[nb].subtreeSize, true);
      }
    }
    return 0;
  } else {
    vertex[root].subtreeSize = totalSubtreeSize;
    if (isFirstInLevel && treeSize > k) {
      cut(root, level + 1, vertex[root].subtreeSize, true);
    }
    return totalSubtreeSize;
  }
}
vector<int> notCutNeighbors;
vector<int> cutNeighbors;
vector<int> oneLevelLess;
void dfs(int node, int level) {
  visited[node] = level;
  notCutNeighbors.push_back(node);
  if (vertex[node].isCutVertex && vertex[node].cutVertexLevel == level + 1)
    oneLevelLess.push_back(node);
  for (int nb : vertex[node].nb) {
    if (vertex[nb].isCutVertex) {
      if (vertex[nb].cutVertexLevel < level) continue;
      if (vertex[nb].cutVertexLevel == level) {
        cutNeighbors.push_back(nb);
        continue;
      }
    }
    if (visited[nb] > level) {
      visited[nb] = level;
      dfs(nb, level);
    }
  }
}
void connect() {
  for (int cut : cutNeighbors) {
    for (int notCut : notCutNeighbors) {
      if (!edges[make_pair(cut, notCut)]) {
        extraEdges.push_back(make_pair(cut, notCut));
      }
    }
  }
  for (int node1 : oneLevelLess) {
    for (int node2 : oneLevelLess) {
      if (node1 == node2) continue;
      if (!edges[make_pair(node1, node2)]) {
        extraEdges.push_back(make_pair(node1, node2));
      }
    }
  }
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n - 1; ++i) {
    cin >> a >> b;
    vertex[a - 1].nb.push_back(b - 1);
    vertex[b - 1].nb.push_back(a - 1);
    edges[make_pair(a - 1, b - 1)] = true;
    edges[make_pair(b - 1, a - 1)] = true;
  }
  vertex[0].parent = -1;
  vertex[0].subtreeSize = n;
  cut(0, 1, n, true);
  for (int i = 0; i < n; ++i) {
    visited[i] = n + 1;
  }
  for (int level = 20; level >= 0; --level) {
    notCutNeighbors.clear();
    cutNeighbors.clear();
    oneLevelLess.clear();
    for (int j = 0; j < n; ++j) {
      if ((!vertex[j].isCutVertex || (vertex[j].cutVertexLevel > level)) &&
          visited[j] > level) {
        dfs(j, level);
        connect();
        notCutNeighbors.clear();
        cutNeighbors.clear();
        oneLevelLess.clear();
      }
    }
  }
  cout << extraEdges.size() << "\n";
  for (auto edge : extraEdges) {
    cout << edge.first + 1 << " " << edge.second + 1 << "\n";
  }
}