Problem: Fishing Prince loves trees, and he especially loves trees with only one centroid. The tree is a connected graph without cycles.

A vertex is a centroid of a tree only when you cut this vertex (remove it and remove all edges from this vertex), the size of the largest connected component of the remaining graph is the smallest possible.

For example, the centroid of the following tree is 2, because when you cut it, the size of the largest connected component of the remaining graph is 2 and it can't be smaller.

<image>

However, in some trees, there might be more than one centroid, for example:

<image>

Both vertex 1 and vertex 2 are centroids because the size of the largest connected component is 3 after cutting each of them.

Now Fishing Prince has a tree. He should cut one edge of the tree (it means to remove the edge). After that, he should add one edge. The resulting graph after these two operations should be a tree. He can add the edge that he cut.

He wants the centroid of the resulting tree to be unique. Help him and find any possible way to make the operations. It can be proved, that at least one such way always exists.

Input

The input consists of multiple test cases. The first line contains an integer t (1≤ t≤ 10^4) — the number of test cases. The description of the test cases follows.

The first line of each test case contains an integer n (3≤ n≤ 10^5) — the number of vertices.

Each of the next n-1 lines contains two integers x, y (1≤ x,y≤ n). It means, that there exists an edge connecting vertices x and y.

It's guaranteed that the given graph is a tree.

It's guaranteed that the sum of n for all test cases does not exceed 10^5.

Output

For each test case, print two lines.

In the first line print two integers x_1, y_1 (1 ≤ x_1, y_1 ≤ n), which means you cut the edge between vertices x_1 and y_1. There should exist edge connecting vertices x_1 and y_1.

In the second line print two integers x_2, y_2 (1 ≤ x_2, y_2 ≤ n), which means you add the edge between vertices x_2 and y_2.

The graph after these two operations should be a tree.

If there are multiple solutions you can print any.

Example

Input


2
5
1 2
1 3
2 4
2 5
6
1 2
1 3
1 4
2 5
2 6


Output


1 2
1 2
1 3
2 3

Note

Note that you can add the same edge that you cut.

In the first test case, after cutting and adding the same edge, the vertex 2 is still the only centroid.

In the second test case, the vertex 2 becomes the only centroid after cutting the edge between vertices 1 and 3 and adding the edge between vertices 2 and 3.

Solution (in JAVA):

Solution:
/**
 * @author Finn Lidbetter
 */
import java.util.*;
import java.io.*;
import java.awt.geom.*;

public class TaskC {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder sb = new StringBuilder();
    
    int nTests = Integer.parseInt(br.readLine());
    for (int test=0; test<nTests; test++) {
      int n = Integer.parseInt(br.readLine());
      Node[] nodes = new Node[n];
      for (int i=0; i<n; i++) {
        nodes[i] = new Node(i);
      }
      for (int i=0; i<n-1; i++) {
        String[] s = br.readLine().split(" ");
        int u = Integer.parseInt(s[0])-1;
        int v = Integer.parseInt(s[1])-1;
        nodes[u].adj.add(v);
        nodes[v].adj.add(u);
      }
      int[] sz = new int[n];
      boolean[] vis = new boolean[n];
      vis[0] = true;
      dfs(0, sz, vis, nodes);
      int curr = 0;
      boolean found = false;
      while (!found) {
        int maxSz = 0;
        int maxNbr = -1;
        for (int nbr:nodes[curr].adj) {
          if (sz[nbr]>maxSz) {
            maxSz = sz[nbr];
            maxNbr = nbr;
          }
        }
        if (maxSz<=n/2) {
          found = true;
        } else {
          shift(curr, maxNbr, sz);
          curr = maxNbr;
        }
      }
      int centroid = curr;
      //System.out.println("Centroid: "+(centroid+1));
      Integer other = null;
      for (int nbr: nodes[centroid].adj) {
        shift(centroid, nbr, sz);
        int maxSz = 0;
        //System.out.printf("Nbr %d has sizes:\n", nbr+1);
        for (int nbrnbr: nodes[nbr].adj) {
          //System.out.printf("\t%d\n", sz[nbrnbr]);
          if (sz[nbrnbr]>maxSz)
            maxSz = sz[nbrnbr];
        }
        shift(nbr, centroid, sz);
        if (maxSz<=n/2) {
          other = nbr;
          break;
        }
      }
      if (other==null) {
        int parent0 = nodes[0].adj.get(0);
        sb.append(String.format("%d %d\n", 1, parent0 + 1));
        sb.append(String.format("%d %d\n", 1, parent0 + 1));
        continue;
      }
      //System.out.printf("Centroids: %d %d\n", centroid, other);
      // Find a leaf on the other subtree we will join it to centroid.
      vis = new boolean[n];
      vis[centroid] = true;
      vis[other] = true;
      int leaf = dfs2(other, vis, nodes);
      int leafParent = nodes[leaf].adj.get(0);
      sb.append(String.format("%d %d\n", leaf+1, leafParent + 1));
      sb.append(String.format("%d %d\n", leaf+1, centroid + 1));
    }
    System.out.print(sb);
  }
  static int dfs2(int curr, boolean[] vis, Node[] nodes) {
    if (nodes[curr].adj.size()==1)
      return curr;
    for (int nbr: nodes[curr].adj) {
      if (!vis[nbr]) {
        vis[nbr] = true;
        return dfs2(nbr, vis, nodes);
      }
    }
    return -1;
  }
  static void shift(int curr, int nbr, int[] sz) {
    int nextCurr = sz[curr] - sz[nbr];
    int nextNbr = sz[nbr] + (sz[curr] - sz[nbr]);
    sz[curr] = nextCurr;
    sz[nbr] = nextNbr;
  }

  static int dfs(int curr, int[] sz, boolean[] vis, Node[] nodes) {
    int subtree = 1;
    for (int nbr: nodes[curr].adj) {
      if (!vis[nbr]) {
        vis[nbr] = true;
        subtree += dfs(nbr, sz, vis, nodes);
      }
    }
    sz[curr] = subtree;
    return subtree;
  }
}
      /*
      boolean[] vis = new boolean[n];
      LinkedList<Integer> q = new LinkedList<>();
      vis[0] = true;
      q.offer(0);
      int depth = 0;
      q.offer(null);
      int maxDepthNode = 0;
      while (q.size()>1) {
        Integer curr = q.poll();
        if (curr==null) {
          depth++;
          q.offer(null);
          continue;
        }
        maxDepthNode = curr;
        for (int nbr: nodes[curr].adj) {
          if (!vis[nbr]) {
            q.offer(nbr);
            vis[nbr] = true;
          }
        }
      }
      int originalMaxDepthNode = maxDepthNode;
      int[] dist = new int[n];
      vis = new boolean[n];
      q = new LinkedList<>();
      depth = 0;
      vis[maxDepthNode] = true;
      q.offer(maxDepthNode);
      q.offer(null);
      while (q.size()>1) {
        Integer curr = q.poll();
        if (curr==null) {
          depth++;
          q.offer(null);
          continue;
        }
        maxDepthNode = curr;
        dist[curr] = depth;
        for (int nbr: nodes[curr].adj) {
          if (!vis[nbr]) {
            q.offer(nbr);
            vis[nbr] = true;
          }
        }
      }
      if (depth%2==0) {
        int nbr0 = nodes[0].adj.get(0) + 1;
        sb.append("1 "+nbr0+"\n");
        sb.append("1 "+nbr0+"\n");
        continue;
      }
      Integer otherLeaf = null;
      for (int i=0; i<n; i++) {
        if (i==maxDepthNode || i==originalMaxDepthNode) {
          continue;
        }
        if (nodes[i].adj.size()==1) {
          otherLeaf = i;
          break;
        }
      }
      if (otherLeaf!=null) {
        int leafParent = nodes[otherLeaf].adj.get(0);
        sb.append(String.format("%d %d\n", otherLeaf+1, leafParent+1));
        sb.append(String.format("%d %d\n", otherLeaf+1, maxDepthNode+1));
      } else {
        // It's a path.
        int midNode = -1;
        int maxDepthParent = nodes[maxDepthNode].adj.get(0);
        for (int nbr: nodes[maxDepthParent].adj) {
          if (nbr!=maxDepthNode) {
            midNode = nbr;
            break;
          }
        }
        sb.append(String.format("%d %d\n", maxDepthNode+1, maxDepthParent+1));
        sb.append(String.format("%d %d\n", maxDepthNode+1, midNode+1));
      }
    }

    System.out.print(sb);
  }
}
*/
class Node {
  int id;
  ArrayList<Integer> adj;
  public Node(int idd) {
    adj = new ArrayList<Integer>();
  }
}

class MyUtils {
  static void shuffleArray(int[] arr) {
    int n = arr.length;
    Random rnd = new Random();
    for(int i=0; i<n; i++) {
      int tmp = arr[i];
      int randomPos = i + rnd.nextInt(n-i);
      arr[i] = arr[randomPos];
      arr[randomPos] = tmp;
    }
  }
  static void shuffleArray(long[] arr) {
    int n = arr.length;
    Random rnd = new Random();
    for(int i=0; i<n; i++) {
      long tmp = arr[i];
      int randomPos = i + rnd.nextInt(n-i);
      arr[i] = arr[randomPos];
      arr[randomPos] = tmp;
    }
  }
}