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:
import java.io.*;
import java.io.IOException;
import java.lang.reflect.Array;
import java.util.*;
import java.util.function.DoublePredicate;


//import javafx.util.Pair; 
//import java.util.concurrent.LinkedBlockingDeque;







    
 public class Codeforces {
     
        
        public static long mod = (long)Math.pow(10,9)+7 ;
        public static double epsilon=0.00000000008854;//value of epsilon
        public static InputReader sc = new InputReader(System.in);
        public static PrintWriter pw = new PrintWriter(System.out);
        
        // fun(n,sum)=fun(n-1,sum)+fun(n-1,sum-n^x);
        public static ArrayList<ArrayList <Integer>> GetGraph(int n,int m,int l[][]){
            ArrayList<ArrayList <Integer>> a=new ArrayList<>();
            for(int i=0;i<n;i++){
                a.add(new ArrayList<>());
            }
            for(int i=0;i<m;i++){
                int u=sc.nextInt()-1;
                int v=sc.nextInt()-1;
                l[i][0]=u+1;
                l[i][1]=v+1;
                a.get(u).add(v);
                a.get(v).add(u);
            } 
            return a;
        }
        public static int dfs(int u,int vis[],int down[],int value[],ArrayList<ArrayList <Integer>> g,int p[]){
            down[u]=1;
            vis[u]=1;
            int max=0;
            for(int i=0;i<g.get(u).size();i++){
                int v=g.get(u).get(i);
                if(vis[v]!=1){
                    p[v]=u;
                    int val=dfs(v, vis, down, value, g,p);
                    max=Math.max(val, max);
                    down[u]+=val;
                }
            }
            value[u]=Math.max(g.size()-down[u], max);
            return down[u];
        }
        public static void main(String[] args) {
            // code starts..
            int q=sc.nextInt();
            while(q-->0){
                int n=sc.nextInt();
                int l[][]=new int[n-1][2];
                HashMap<Integer,Integer> h=new HashMap<>();
                ArrayList<ArrayList <Integer>> g=GetGraph(n, n-1,l);
                int value[]=new int[n];
                int down[]=new int[n];
                int p[]=new int[n];
                p[0]=-1;
                dfs(0, new int[n], down, value, g,p);
                int min=n;int c=0;
                //pw.println(Arrays.toString(value));
                for(int i=0;i<n;i++){
                    min=Math.min(value[i],min);
                }
                int mine=0;
                for(int i=0;i<n;i++){
                    if(value[i]==min){
                        mine=i;
                        c++;
                    }
                }
                //pw.println(c);
                if(c==1){
                    pw.println(l[0][0]+" "+l[0][1]);
                    pw.println(l[0][0]+" "+l[0][1]);
                }
                else{
                    int l1=mine,f=0;int r1=0,l2=0,r2=0;
                    for(int i=0;i<g.get(mine).size();i++){
                        int v=g.get(mine).get(i);
                        if(p[mine]!=v&&min==down[v]){
                            f=1;
                            //r1=v;
                            l2=v;
                            break;
                        }
                    }
                    if(f==0){
                        //r1=p[mine];
                        l2=p[mine];
                    }
                    for(int i=0;i<g.get(mine).size();i++){
                        int v=g.get(mine).get(i);
                        if(v!=l2){
                            r2=v;
                            break;
                        }
                    }
                    l1++;
                    l2++;
                    r1++;
                    r2++;
                    pw.println(l1+" "+r2);
                    pw.println(l2+" "+r2);

                }
                
            }
            



            
            // Code ends...
            pw.flush();
            pw.close();
        }
       
        public static Comparator<Long[]> column(int i){
            return 
            new Comparator<Long[]>() {
                @Override
                public int compare(Long[] o1, Long[] o2) {
                    return o1[i].compareTo(o2[i]);//for ascending
                    //return o2[i].compareTo(o1[i]);//for descending
                }
            };
        }
        public static Comparator<Integer[]> col(int i){
            return 
            new Comparator<Integer[]>() {
                @Override
                public int compare(Integer[] o1, Integer[] o2) {
                    return o1[i].compareTo(o2[i]);//for ascending
                    //return o2[i].compareTo(o1[i]);//for descending
                }
            };
        }
        public static Comparator<Integer> des(){
            return 
            new Comparator<Integer>() {
                @Override
                public int compare(Integer o1, Integer o2) {
                    //return o1[i].compareTo(o2[i]);//for ascending
                    return o2.compareTo(o1);//for descending
                }
            };
        }
        
        
        
        
        public static String reverseString(String s){
            StringBuilder input1 = new StringBuilder(); 
            input1.append(s);  
            input1 = input1.reverse();
            return input1.toString();
        }
        public static int[] scanArray(int n){
            int a[]=new int [n];
            for(int i=0;i<n;i++)
            a[i]=sc.nextInt();
    
            return a;
        }
        public static long[] scanLongArray(int n){
            long a[]=new long [n];
            for(int i=0;i<n;i++)
            a[i]=sc.nextLong();
    
            return a;
        }
        public static String [] scanStrings(int n){
            String a[]=new String [n];
            for(int i=0;i<n;i++)
            a[i]=sc.nextLine();
    
            return a;
        }
        public static class InputReader {
    
            private final InputStream stream;
            private final byte[] buf = new byte[8192];
            private int curChar, snumChars;
            private SpaceCharFilter filter;
    
            public InputReader(InputStream stream) {
                this.stream = stream;
            }
    
            public int snext() {
                if (snumChars == -1)
                    throw new InputMismatchException();
                if (curChar >= snumChars) {
                    curChar = 0;
                    try {
                        snumChars = stream.read(buf);
                    } catch (IOException e) {
                        throw new InputMismatchException();
                    }
                    if (snumChars <= 0)
                        return -1;
                }
                return buf[curChar++];
            }
    
            public int nextInt() {
                int c = snext();
                while (isSpaceChar(c)) {
                    c = snext();
                }
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = snext();
                }
                int res = 0;
                do {
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = snext();
                } while (!isSpaceChar(c));
                return res * sgn;
            }
    
            public long nextLong() {
                int c = snext();
                while (isSpaceChar(c)) {
                    c = snext();
                }
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = snext();
                }
                long res = 0;
                do {
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = snext();
                } while (!isSpaceChar(c));
                return res * sgn;
            }
    
            public int[] nextIntArray(int n) {
                int a[] = new int[n];
                for (int i = 0; i < n; i++) {
                    a[i] = nextInt();
                }
                return a;
            }
    
            public String readString() {
                int c = snext();
                while (isSpaceChar(c)) {
                    c = snext();
                }
                StringBuilder res = new StringBuilder();
                do {
                    res.appendCodePoint(c);
                    c = snext();
                } while (!isSpaceChar(c));
                return res.toString();
            }
    
            public String nextLine() {
                int c = snext();
                while (isSpaceChar(c))
                    c = snext();
                StringBuilder res = new StringBuilder();
                do {
                    res.appendCodePoint(c);
                    c = snext();
                } while (!isEndOfLine(c));
                return res.toString();
            }
    
            public boolean isSpaceChar(int c) {
                if (filter != null)
                    return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
            }
    
            private boolean isEndOfLine(int c) {
                return c == '\n' || c == '\r' || c == -1;
            }
    
            public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
            }
        }
        
    }
    class SegmentTree{
    int s[],n;
    
    int li[];
    long qn[];
	SegmentTree(int a[],long q[]){
        n=a.length;
        qn=q;
        li=a;
		int l=(int)Math.ceil(Math.log(n)/Math.log(2));
		l=2*(int)Math.pow(2,l)-1;
		s=new int[l];
		createSegmentTreeUtil(a, 0, 0, a.length-1);
	}
	
	int createSegmentTreeUtil(int a[],int root,int l,int r){
		if(l==r)
		s[root]=l;
		else
		s[root]= Compare(createSegmentTreeUtil(a, 2*root+1, l, (l+r)/2), createSegmentTreeUtil(a,2*root+2, (l+r)/2+1,r));
		return s[root];
	}
	int getValue(int gl,int gr){
		return getValueUtil(0, 0, n-1, gl, gr);
	}
	int getValueUtil(int root,int l,int r,int gl,int gr){
		if(l>=gl&&r<=gr){
			return s[root];
		}
		if(l>gr||r<gl){
			return n;
		}
		return Compare(getValueUtil(2*root+1, l, (l+r)/2, gl, gr), getValueUtil(2*root+2, (l+r)/2+1, r, gl, gr));
	}
	void update(int p,int k){
		updateUtil(p, k,0,0,n-1);
	}
	int updateUtil(int p,int k,int root,int l,int r){
		if(l==r&&l==k){
			return s[root]=p;
		}
		else if(l>k||r<k)
		return s[root];
		else{
			return s[root]=Compare(updateUtil(p, k, 2*root+1, l, (l+r)/2), updateUtil(p, k, 2*root+2,(l+r)/2+1,r ));
		}
	}
	int Compare(int a,int b){
        if(a>=n&&b>=n){
            System.out.println("adfna");
        }
        
		if(a>=n){
            return b;
        }
        if(b>=n){
            return a;
        }
        if(li[a]==li[b]){
            if(qn[a]>qn[b]){
                return a;
            }
            else return b;
        }
        else if(li[a]<li[b])
        return b;
        else return a;


	}
}