Polycarp has come up with a new game to play with you. He calls it "A missing bigram".

A bigram of a word is a sequence of two adjacent letters in it.

For example, word "abbaaba" contains bigrams "ab", "bb", "ba", "aa", "ab" and "ba".

The game goes as follows. First, Polycarp comes up with a word, consisting only of lowercase letters 'a' and 'b'. Then, he writes down all its bigrams on a whiteboard in the same order as they appear in the word. After that, he wipes one of them off the whiteboard.

Finally, Polycarp invites you to guess what the word that he has come up with was.

Your goal is to find any word such that it's possible to write down all its bigrams and remove one of them, so that the resulting sequence of bigrams is the same as the one Polycarp ended up with.

The tests are generated in such a way that the answer exists. If there are multiple answers, you can print any of them.

Input

The first line contains a single integer t (1 ≤ t ≤ 2000) — the number of testcases.

The first line of each testcase contains a single integer n (3 ≤ n ≤ 100) — the length of the word Polycarp has come up with.

The second line of each testcase contains n-2 bigrams of that word, separated by a single space. Each bigram consists of two letters, each of them is either 'a' or 'b'.

Additional constraint on the input: there exists at least one string such that it is possible to write down all its bigrams, except one, so that the resulting sequence is the same as the sequence in the input. In other words, the answer exists.

Output

For each testcase print a word, consisting of n letters, each of them should be either 'a' or 'b'. It should be possible to write down all its bigrams and remove one of them, so that the resulting sequence of bigrams is the same as the one Polycarp ended up with.

The tests are generated in such a way that the answer exists. If there are multiple answers, you can print any of them. 

Example

Input


4
7
ab bb ba aa ba
7
ab ba aa ab ba
3
aa
5
bb ab bb


Output


abbaaba
abaabaa
baa
bbabb

Note

The first two testcases from the example are produced from the word "abbaaba". As listed in the statement, it contains bigrams "ab", "bb", "ba", "aa", "ab" and "ba".

In the first testcase, the 5-th bigram is removed. 

In the second testcase, the 2-nd bigram is removed. However, that sequence could also have been produced from the word "abaabaa". It contains bigrams "ab", "ba", "aa", "ab", "ba" and "aa". The missing bigram is the 6-th one.

In the third testcase, all of "baa", "aab" and "aaa" are valid answers.
4
7
ab bb ba aa ba
7
ab ba aa ab ba
3
aa
5
bb ab bb

abbaaba
abaabaa
aaa
bbabb

    import java.math.*;
    import java.io.*;
    import java.util.*;

    
//-------------------------------///////////////****/////////******//////////
//------------------------------------///**********//*****//********//*****//
//-----------------------------------///**********//*****//********//*****//
//----------------------------------///**********//*****//********//*****//
//---------------------------------///**********//*****//********//*****//
//--------------------------------///**********//*****//********//*****//
//--------------------------///**///**********//*****//********//*****//
//---------------------------/////***********/////////*******//////////

    
    public class CodeForces
    {
    	final static String no = "NO";
    	final static String yes = "YES";
    	static long count = 0;
    	
    	static public OutputWriter w = new OutputWriter(System.out);
    	static public FastScanner sc = new FastScanner();
    	

    	static HashMap<Integer,Integer> map = new HashMap<>();
    	
    	static Scanner fc = new Scanner(System.in);

//*******************************************Be SANSA**********************************************************
//************************************Don't stick to single approach********************************************	
//*****************************************You are a slow learner But you learn*********************************
//***************************************Don't fall in rating trap***********************************************
//**********************************Pain in temporary, regret remains forever************************************
    	
    	
        public static void main(String[] args) {
        	int test =sc.nextInt();
        	in:
        	while(test-->0) {
        		int n = sc.nextInt();
    			String[]arr = new String[n-2];
    			for(int i =0;i<n-2;i++) {
    				arr[i] = sc.next();
    			}
    			String res = arr[0];
    			for(int i=1;i<n-2;i++) {
    				if(res.charAt(res.length()-1)!=arr[i].charAt(0)) {
    					//res+=res.charAt(res.length()-1);
    					res+=arr[i];
    				}else {
    					res+=arr[i].charAt(1);
    				}
    			}
    			if(res.length()<n) {
    				res+='a';
    			}
    			w.writer.println(res);
        	}
        	w.writer.flush();	
        }
        
        static int sod(long  n) {
        	int res = 0;
        	while(n!=0) {
        		res+=n%10;
        		n = n/10;
        	}
			return res;
		}
		static class Pair {
            int visits, index;
            Pair(int visits, int index) {
                this.visits = visits;
                this.index = index;
            }
        }
        static public boolean checkBit(int n,int i){
            if((n>>i & 1)==1){
                return true;
            }else{
                return false;
            }
        }
        public static long pow(long a,long p)
        {
            long res=1;
            while(p>0)
            {
                if(p%2==1)
                {
                    p--;
                    res*=a;
                    res%=(long)1e9+7;
                }
                else
                {
                    a*=a;
                    a%=(long)1e9+7;
                    p/=2;
                }
            }
            return res;
        }
        static int gcd(int a, int b){
            if (a == 0)
                return b;
            return gcd(b % a, a);
        }
        static long gcd(long a, long b){
            if (a == 0)
                return b;
            return gcd(b % a, a);
        }
         
        // method to return LCM of two numbers
        static long lcm(long a, long b)
        {
            return (a / gcd(a, b)) * b;
        }
        static long getPairsCount(long[] arr, long sum)
        {
            Map<Long, Long> hm = new HashMap<>();
            int n = arr.length;
            long count = 0;
            for(int i =0;i<n;i++) {
            	if(hm.containsKey(sum - arr[i])) {
            		count+=hm.get(sum-arr[i]);
            	}
            	if(hm.get(arr[i])!=null) {
            		hm.put(arr[i], hm.get(arr[i])+1);
            	}
            	else {
            		hm.put(arr[i], 1l);
            	}
            }
            return count;
        }
        static long sumLong(int[]arr) {
        	long sum =0;
        	for(int x:arr) {
        		sum+=x;
        	}
        	return sum;
        }
        static boolean isEqualList(ArrayList<Integer> arr,ArrayList<Integer> temp){
            for(int i =0;i<arr.size();i++){
                if(arr.get(i)!=temp.get(i)){
                    return true;
                }
            }
            return false;
        }
    	static void sort(int[] arr) {
            Random rand = new Random();
            int n = arr.length;
            for (int i = 0; i < n; i++) {
                int idx = rand.nextInt(n);
                if (idx == i) continue;
                arr[i] ^= arr[idx];
                arr[idx] ^= arr[i];
                arr[i] ^= arr[idx];
            }
            Arrays.sort(arr);
        }
     
        static void sort(long[] arr) {
            Random rand = new Random();
            int n = arr.length;
            for (int i = 0; i < n; i++) {
                int idx = rand.nextInt(n);
                if (idx == i) continue;
                arr[i] ^= arr[idx];
                arr[idx] ^= arr[i];
                arr[i] ^= arr[idx];
            }
            Arrays.sort(arr);
        }
     
        static void sortDec(int[] arr) {
            Random rand = new Random();
            int n = arr.length;
            for (int i = 0; i < n; i++) {
                int idx = rand.nextInt(n);
                if (idx == i) continue;
                arr[i] ^= arr[idx];
                arr[idx] ^= arr[i];
                arr[i] ^= arr[idx];
            }
            Arrays.sort(arr);
            int l = 0;
            int r = n - 1;
            while (l < r) {
                arr[l] ^= arr[r];
                arr[r] ^= arr[l];
                arr[l] ^= arr[r];
                l++;
                r--;
            }
        }
     
        static void sortDec(long[] arr) {
            Random rand = new Random();
            int n = arr.length;
            for (int i = 0; i < n; i++) {
                int idx = rand.nextInt(n);
                if (idx == i) continue;
                arr[i] ^= arr[idx];
                arr[idx] ^= arr[i];
                arr[i] ^= arr[idx];
            }
            Arrays.sort(arr);
            int l = 0;
            int r = n - 1;
            while (l < r) {
                arr[l] ^= arr[r];
                arr[r] ^= arr[l];
                arr[l] ^= arr[r];
                l++;
                r--;
            }
        }
    	
    	
    	static int[] countInversions(int[]arr,int low,int high){
    		if(low==high) {
    			int base[] = new int[1];
    			base[0] = arr[low];
    			return base;
    		}
    		int mid = low+(high-low)/2;
    		int left[] = countInversions(arr,low,mid);
    		int right[] = countInversions(arr,mid+1,high);
    		int[]merged = merge(left,right);
    		return merged;
    	}
    	
    	
    	static int[] merge(int first[], int[]next) {
    		
    		int i = 0;
    		int j = 0;
    		int k = 0;
    		int[]merged = new int[first.length+next.length];
    		while(j<first.length && k<next.length) {
    			if(first[j]<=next[k]) {
    				merged[i++] = first[j++];
    			}else {
    				count += first.length -j;
    				merged[i++] = next[k++];
    				
    			}
    		}
    		while(j<first.length) {
    			merged[i++] = first[j++];
    		}
    		while(k<next.length) {
    			merged[i++] = next[k++];
    		}
    		return merged;
    	}
    	static class FastScanner {
    		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    		StringTokenizer st=new StringTokenizer("");
    		String next() {
    			while (!st.hasMoreTokens())
    				try {
    					st=new StringTokenizer(br.readLine());
    				} catch (IOException e) {
    					e.printStackTrace();
    				}
    			return st.nextToken();
    		}
    		
    		int nextInt() {
    			return Integer.parseInt(next());
    		}
    		int [] readArray(int n) {
    			int[] a=new int[n];
    			for (int i=0; i<n; i++) a[i]=nextInt();
    			return a;
    		}
    		long nextLong() {
    			return Long.parseLong(next());
    		}
    		long [] longArray(int n) {
    			long[] a=new long[n];
    			for(int i=0 ; i<n ; i++) a[i]=nextLong();
    			return a;
    		}
    		double nextDouble() {
    			return Double.parseDouble(next());
    		}
    	}
        static public class OutputWriter {
            private  final PrintWriter writer;
     
            public OutputWriter(OutputStream outputStream) {
                writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
            }
     
            public OutputWriter(Writer writer) {
                this.writer = new PrintWriter(writer);
            }
     
            public void print(Object... objects) {
                for (int i = 0; i < objects.length; i++) {
                    if (i != 0)
                        writer.print(' ');
                    writer.print(objects[i]);
                }
            }
     
            public void printLine(Object... objects) {
                print(objects);
                writer.println();
            }
     
            public void close() {
                writer.close();
            }
        }
     
     
    }