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.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.InputMismatchException;

public class Solution 
{
	static InputReader in= new InputReader(System.in);
	static ArrayList<Integer>[] g;
	static int[] parent, size;
	static int cent1, cent2, compSize, leaf;
	
    public static void main(String args[]) {
        new Thread(null, new Runnable() {
            public void run() {
                try{
                    solve();
                }
                catch(Exception e){
                    e.printStackTrace();
                }
            }
        }, "1", 1 << 26).start();
    }
    
    public static void solve(){
    	int t =in.nextInt();
    	while(t-->0) {
    		int n = in.nextInt();
    		g = new ArrayList[n];
    		parent = new int[n];
    		size = new int[n];
    		cent1 = cent2 = -1;
    		compSize =  Integer.MAX_VALUE;
    		for(int i = 0; i < n; i++) g[i] = new ArrayList<>();
    		for(int i  = 0; i < n - 1; i++) {
    			int x = in.nextInt() - 1;
    			int y = in.nextInt() - 1;
    			g[x].add(y);
    			g[y].add(x);
    		}
    		dfs(0, -1);
//    		pn(Arrays.toString(size));
//    		pn(Arrays.toString(parent));
    		if(cent2 == -1) {
    			pn(1 + " " + (g[0].get(0) + 1));
    			pn(1 + " " + (g[0].get(0) + 1));
    		} else {
    			if(parent[cent2] != cent1) {
    				int temp = cent1;
    				cent1 = cent2;
    				cent2 = temp;
    			}
    			dfs2(cent2, cent1);
//    			pn("P "+cent2 +" " +parent[cent2]);
    			pn((parent[leaf] + 1) + " " + (leaf + 1));
    			pn((cent1 + 1) + " " + (leaf + 1));
    		}
    	}
    }
    
    private static void dfs(int u, int p) {
    	parent[u] = p;
    	size[u] = 1;
    	int maxSize = 0;
    	for(int v: g[u]) {
    		if(v == p) continue;
    		dfs(v, u);
    		size[u] += size[v];
    		maxSize = Math.max(maxSize, size[v]);
    	}
    	maxSize = Math.max(maxSize, g.length - size[u]);
    	if(maxSize < compSize) {
    		cent1 = u;
    		cent2 = -1;
    		compSize = maxSize;
    	} else if(maxSize == compSize) {
    		cent2 = u;
    	}
    }
    
    private static void dfs2(int u, int p) {
    	if(g[u].size() == 1) {
    		leaf = u;
    		return;
    	}
    	for(int v: g[u]) {
    		if(v == p) continue;
    		dfs2(v, u);
    	}
    }
   
    /*TEMPLATE*/
    
    //MATHS
    static int gcd(int a, int b) {
    	return (b==0)?a:gcd(b,a%b);
    }
    
    static long mod(long x, long p) {
        x %= p;
        if (x < 0)
            x += p;
        return x;
    }
    
    static long pow(long a, int b, int c)  {  
        if (a == 0)  
            return 0;  
        if (b == 0)  
            return 1;  
  
        long y;  
        if (b % 2 == 0) {  
            y = pow(a, b / 2, c);  
            y = (y * y) % c;  
        }
        else {  
            y = a % c;  
            y = (y * pow(a, b - 1,  c) % c) % c;  
        }  

        return ((y+c) % c);  
    }
    
    public static int[] spf(int maxn) {
    	int[] spf=new int[maxn+1];
    	spf[0]=spf[1]=1;
    	for(int i=2;i<=maxn;i++) {
    		if(i%2==0) spf[i]=2;
    		else 
    			spf[i]=i;
    	}
    	for(int i=3;i*i<=maxn;i++) {
    		if(spf[i]==i){
    			for (int j=i*i; j<=maxn; j+=i) 
                    if (spf[j]==j) 
                        spf[j] = i;
    		}
    	}
    	return spf;
    }
    
    //ARRAYS
    public static int[] intArray(int n) {
    	int ar[]=new int[n];
    	for(int i=0;i<n;i++)
    		ar[i]=in.nextInt();
    	return ar;
    }
    
    public static void swap(int i, int j, int ar[]) {
    	int c=ar[i];ar[i]=ar[j];ar[j]=c;
    }
    
    public static void reverse(int ar[]) {
    	int l=0, r=ar.length-1;
    	while(l<r) {
    		int temp=ar[l]; ar[l]=ar[r]; ar[r]=temp;
    		l++; r--;
    	}
    }
    
    public static int upperBound(int[] array, int value) {
    	//return next higher element. If greater than all elements then returns array.length
    	//returns 0 if smaller than all elements
    	int low = 0;
    	int high = array.length;
    	while (low < high) {
    		final int mid = (low + high) / 2;
    		if (value >= array[mid]) {
    			low = mid + 1;
    		} else {
    			high = mid;
    		}
    	}
    	return low;
    }
    
    public static int lowerBound(int[] array, int value) {
    	//Returns first occurrence.
    	//Bigger than all elements then return array.length
    	//Not found, then next greater.s
    	int low = 0;
    	int high = array.length;
    	while (low < high) {
    		final int mid = (low + high) / 2;
			if (value <= array[mid]) {
			high = mid;
			} else {
				low = mid + 1;
			}
    	}
    	return low;
	}
    
    public static void pn(Object o) {
      System.out.println(o);
    }
    
    static class InputReader {
 
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int 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 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 boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}