description: 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.
solution: # cook your dish here
  import os
  import sys
  from io import BytesIO, IOBase
   
  BUFSIZE = 8192
   
   
  class FastIO(IOBase):
      newlines = 0
   
      def __init__(self, file):
          self._fd = file.fileno()
          self.buffer = BytesIO()
          self.writable = "x" in file.mode or "r" not in file.mode
          self.write = self.buffer.write if self.writable else None
   
      def read(self):
          while True:
              b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
              if not b:
                  break
              ptr = self.buffer.tell()
              self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
          self.newlines = 0
          return self.buffer.read()
   
      def readline(self):
          while self.newlines == 0:
              b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
              self.newlines = b.count(b"\n") + (not b)
              ptr = self.buffer.tell()
              self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
          self.newlines -= 1
          return self.buffer.readline()
   
      def flush(self):
          if self.writable:
              os.write(self._fd, self.buffer.getvalue())
              self.buffer.truncate(0), self.buffer.seek(0)
   
   
  class IOWrapper(IOBase):
      def __init__(self, file):
          self.buffer = FastIO(file)
          self.flush = self.buffer.flush
          self.writable = self.buffer.writable
          self.write = lambda s: self.buffer.write(s.encode("ascii"))
          self.read = lambda: self.buffer.read().decode("ascii")
          self.readline = lambda: self.buffer.readline().decode("ascii")
  
  class SegmentTree:
      def __init__(self, data, default, func):
          """initialize the segment tree with data"""
          self._default = default
          self._func = func
          self._len = len(data)
          self._size = _size = 1 << (self._len - 1).bit_length()
  
          self.data = [default] * (2 * _size)
          self.data[_size:_size + self._len] = data
          for i in reversed(range(_size)):
              self.data[i] = func(self.data[i + i], self.data[i + i + 1])
  
      def __delitem__(self, idx):
          self[idx] = self._default
  
      def __getitem__(self, idx):
          return self.data[idx + self._size]
  
      def __setitem__(self, idx, value):
          idx += self._size
          self.data[idx] = value
          idx >>= 1
          while idx:
              self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
              idx >>= 1
  
      def __len__(self):
          return self._len
  
      def query(self, start, stop):
          """func of data[start, stop)"""
          start += self._size
          stop += self._size
  
          res_left = res_right = self._default
          while start < stop:
              if start & 1:
                  res_left = self._func(res_left, self.data[start])
                  start += 1
              if stop & 1:
                  stop -= 1
                  res_right = self._func(self.data[stop], res_right)
              start >>= 1
              stop >>= 1
  
          return self._func(res_left, res_right)
  
      def __repr__(self):
          return "SegmentTree({0})".format(self.data)
   
   
  sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
  input = lambda: sys.stdin.readline().rstrip("\r\n")
  from collections import defaultdict,deque
  from math import ceil,floor,sqrt,log2,gcd,pi
  from heapq import heappush,heappop
  from bisect import bisect_left,bisect
  from functools import reduce
  from copy import deepcopy
  from itertools import permutations
  # from itertools import zip
  import sys
  abc='abcdefghijklmnopqrstuvwxyz'
  ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  dig='012345678901'
  odd='13579'
  mod=998244353 
  
  for _ in range(int(input())):
      n=int(input())
      arr=list(input().split())
      ans=""
      for i in arr:
          if ans!='' and ans[-1]==i[0]:
              ans+=i[1]
          else:
              ans+=i
      if len(ans)!=n:
          ans+=(n-len(ans))*'a'
      print(ans)