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.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.*;
import java.util.concurrent.ThreadLocalRandom;



public class a729 {

	public static void main(String[] args) throws IOException {
       BufferedWriter out = new BufferedWriter(
	            new OutputStreamWriter(System.out));
		BufferedReader br = new BufferedReader(
		        new InputStreamReader(System.in));
		PrintWriter pt = new PrintWriter(System.out);
		FastReader sc = new FastReader();

		int t = sc.nextInt();
		for(int o = 0 ; o<t;o++){
		int n = sc.nextInt();
		String[] arr = new String[n];
		for(int i = 0 ; i<n-2;i++) {
			arr[i] = sc.next();
			}
		
		String ans= "";
		StringBuilder s = new StringBuilder("");
		int f = 0;
		ans= ans+ arr[0];
		s.append(arr[0]);
		for(int i = 1; i<n-2;i++) {
			if(ans.charAt(ans.length()-1) == arr[i].charAt(0)) {
				ans= ans + arr[i].charAt(1);
				s.append(arr[i].charAt(1));
			}else {
				f = 1;
				ans= ans + arr[i];
			s.append(arr[i]);
			}
		}
		if(f == 0) {
//			ans+='a';
			s.append('a');
		}
		System.out.println(s);
//		System.out.println("xyq");
//		System.err.println(ans);
		}
	
	
	}
//------------------------------------------------------------------------------------------------------------------------------------------------
	
	public static boolean check(int[] arr,int v,HashSet<Integer> vis) {
		for(int i = 0 ; i<arr.length;i++) {
			if(vis.contains(i)) {
				continue;
			}
		if(arr[i] == v) {
			vis.add(i);
			return true;
		}
		
		}
		return false;
		
		
		
		
		
	}
	
	
	public static int count(long x) {
		int a = 0;
		while(x>0) {
			x/=2;
			a++;
		}
		return a;
		
	}
	

	public static long ncr(long[] fac, int n , int r , long m) {
		return fac[n]*(modInverse(fac[r], m))%m *(modInverse(fac[n-r], m))%m; 
	}
	
	
	public static void build(int [][] seg,char []arr,int idx, int lo , int hi) {
	if(lo == hi) {
//		seg[idx] = arr[lo];
		seg[idx][(int)arr[lo]-'a'] = 1;
		
		return;
	}
	int mid = (lo + hi)/2;
build(seg,arr,2*idx+1, lo, mid);
build(seg,arr,idx*2+2, mid +1, hi);
//seg[idx] = Math.min(seg[2*idx+1],seg[2*idx+2]);
for(int i = 0 ; i<27;i++) {
	seg[idx][i] = seg[2*idx+1][i] + seg[2*idx + 2][i];
}
	}
//for f/inding minimum in range 
public static void query(int[][]seg,int[]ans,int idx , int lo , int hi , int l , int r) {
	if(lo>=l && hi<=r) {
		for(int i = 0 ; i<27;i++) {
			ans[i]+= seg[idx][i];
		}
		return ;
	}
if(hi<l || lo>r) {
	return;
}
int mid = (lo + hi)/2;
query(seg,ans,idx*2 +1, lo, mid, l, r);
query(seg,ans,idx*2 + 2, mid + 1, hi, l, r);
//return Math.min(left, right);
}
//// for sum
//
public static void update(int[][]seg,char[]arr,int idx, int lo , int hi , int node , char val) {
if(lo == hi) {
//	seg[idx] += val;
seg[idx][val-'a']++;
seg[idx][arr[node]-'a']--;

}else {
int mid = (lo + hi )/2;
if(node<=mid && node>=lo) {
update(seg,arr, idx * 2 +1, lo, mid, node, val);
}else {
update(seg,arr, idx*2 + 2, mid + 1, hi, node, val);
}
//seg[idx] = seg[idx*2 + 1] + seg[idx*2 + 2];
for(int i = 0 ; i<27;i++) {
	seg[idx][i] = seg[2*idx+1][i] + seg[2*idx + 2][i];
}
}

}
	
	
	
	
	
	
	public static int lower_bound(int array[], int low, int high, int key){
	// Base Case
	if (low > high) {
	return low;
	}

	// Find the middle index
	int mid = low + (high - low) / 2;

	// If key is lesser than or equal to
	// array[mid] , then search
	// in left subarray
	if (key <= array[mid]) {

	return lower_bound(array, low,
	            mid - 1, key);
	}

	// If key is greater than array[mid],
	// then find in right subarray
	return lower_bound(array, mid + 1, high,
	        key);
	}
	
	public static int upper_bound(int arr[], int low,
            int high, int key){
// Base Case
if (low > high || low == arr.length)
return low;

// Find the value of middle index
int mid = low + (high - low) / 2;

// If key is greater than or equal
// to array[mid], then find in
// right subarray
if (key >= arr[mid]) {
return upper_bound(arr, mid + 1, high,
                key);
}

// If key is less than array[mid],
// then find in left subarray
return upper_bound(arr, low, mid - 1,
            key);
}

//	-----------------------------------------------------------------------------------------------------------------------------------------------
	public static int gcd(int a, int b){
        if (a == 0)
            return b;
        return gcd(b % a, a);
    }
//--------------------------------------------------------------------------------------------------------------------------------------------------------
	public static long modInverse(long a, long m){
        long m0 = m;
        long y = 0, x = 1;
 
        if (m == 1)
            return 0;
 
        while (a > 1) {
            // q is quotient
            long q = a / m;
 
            long t = m;
 
            // m is remainder now, process
            // same as Euclid's algo
            m = a % m;
            a = t;
            t = y;
 
            // Update x and y
            y = x - q * y;
            x = t;
        }
 
        // Make x positive
        if (x < 0)
            x += m0;
 
        return x;
    }

		

//-----------------------------------------------------------------------------------------------------------------------------------

	//segment tree
	//for finding minimum in range 
//	public static void build(int [] seg,int []arr,int idx, int lo , int hi) {
//		if(lo == hi) {
//			seg[idx] = arr[lo];
//			return;
//		}
//		int mid = (lo + hi)/2;
//	build(seg,arr,2*idx+1, lo, mid);
//	build(seg,arr,idx*2+2, mid +1, hi);
//	seg[idx] = Math.min(seg[2*idx+1],seg[2*idx+2]);
//	}
////for finding minimum in range 
//public static int query(int[]seg,int idx , int lo , int hi , int l , int r) {
//		if(lo>=l && hi<=r) {
//			return seg[idx];
//		}
//	if(hi<l || lo>r) {
//		return Integer.MAX_VALUE;
//	}
//	int mid = (lo + hi)/2;
//	int left = query(seg,idx*2 +1, lo, mid, l, r);
//	int right = query(seg,idx*2 + 2, mid + 1, hi, l, r);
//	return Math.min(left, right);
//}
//	// for sum
//
//public static void update(int[]seg,int idx, int lo , int hi , int node , int val) {
//	if(lo == hi) {
//		seg[idx] += val;
//	}else {
//int mid = (lo + hi )/2;
//if(node<=mid && node>=lo) {
//	update(seg, idx * 2 +1, lo, mid, node, val);
//}else {
//	update(seg, idx*2 + 2, mid + 1, hi, node, val);
//}
//seg[idx] = seg[idx*2 + 1] + seg[idx*2 + 2];
//
//}

//}
//---------------------------------------------------------------------------------------------------------------------------------------


	static void shuffleArray(int[] ar)
	  {
	    // If running on Java 6 or older, use `new Random()` on RHS here
	    Random rnd = ThreadLocalRandom.current();
	    for (int i = ar.length - 1; i > 0; i--)
	    {
	      int index = rnd.nextInt(i + 1);
	      // Simple swap
	      int a = ar[index];
	      ar[index] = ar[i];
	      ar[i] = a;
	    }
	  }
//-----------------------------------------------------------------------------------------------------------------------------------------------------------

}


class FastReader {
    BufferedReader br;
    StringTokenizer st;

    public FastReader()
    {
        br = new BufferedReader(
            new InputStreamReader(System.in));
    }

    String next()
    {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());

            
            
            
            
            }
            catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() { return Integer.parseInt(next()); }

    long nextLong() { return Long.parseLong(next()); }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String nextLine()
    {
        String str = "";
        try {
            str = br.readLine();
        }
        catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }
}
//------------------------------------------------------------------------------------------------------------------------------------------------------------
class SegmentTree{
	
int n;
	public SegmentTree(int[] arr,int n) {
		this.arr = arr;
		this.n = n;
	}
	int[] arr = new int[n];
//	int n = arr.length;
	int[] seg = new int[4*n];
	void build(int idx, int lo , int hi) {
		if(lo == hi) {
			seg[idx] = arr[lo];
			return;
		}
		int mid = (lo + hi)/2;
	build(2*idx+1, lo, mid);
	build(idx*2+2, mid +1, hi);
	seg[idx] = Math.min(seg[2*idx+1],seg[2*idx+2]);
	}
	int query(int idx , int lo , int hi , int l , int r) {
		if(lo<=l && hi>=r) {
			return seg[idx];
		}
	if(hi<l || lo>r) {
		return Integer.MAX_VALUE;
	}
	int mid = (lo + hi)/2;
	int left = query(idx*2 +1, lo, mid, l, r);
	int right = query(idx*2 + 2, mid + 1, hi, l, r);
	return Math.min(left, right);
	}
	
	
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------------
class coup{
	int a , b;
	public coup(int a , int b) {
		this.a = a;
		this.b = b;
	}
}

class trip{
	int a , b, c;
	public trip(int a , int b, int c) {
		this.a = a;
		this.b = b;
		this.c = c;
	}
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------------
