A binary string is a string where each character is either 0 or 1. Two binary strings $a$ and $b$ of equal length are similar, if they have the same character in some position (there exists an integer $i$ such that $a_i = b_i$). For example:  10010 and 01111 are similar (they have the same character in position $4$);  10010 and 11111 are similar;  111 and 111 are similar;  0110 and 1001 are not similar. 

You are given an integer $n$ and a binary string $s$ consisting of $2n-1$ characters. Let's denote $s[l..r]$ as the contiguous substring of $s$ starting with $l$-th character and ending with $r$-th character (in other words, $s[l..r] = s_l s_{l + 1} s_{l + 2} \dots s_r$).

You have to construct a binary string $w$ of length $n$ which is similar to all of the following strings: $s[1..n]$, $s[2..n+1]$, $s[3..n+2]$, ..., $s[n..2n-1]$.


-----Input-----

The first line contains a single integer $t$ ($1 \le t \le 1000$) — the number of test cases.

The first line of each test case contains a single integer $n$ ($1 \le n \le 50$).

The second line of each test case contains the binary string $s$ of length $2n - 1$. Each character $s_i$ is either 0 or 1.


-----Output-----

For each test case, print the corresponding binary string $w$ of length $n$. If there are multiple such strings — print any of them. It can be shown that at least one string $w$ meeting the constraints always exists.


-----Example-----
Input
4
1
1
3
00000
4
1110000
2
101

Output
1
000
1010
00



-----Note-----

The explanation of the sample case (equal characters in equal positions are bold):

The first test case:   $\mathbf{1}$ is similar to $s[1..1] = \mathbf{1}$. 

The second test case:   $\mathbf{000}$ is similar to $s[1..3] = \mathbf{000}$;  $\mathbf{000}$ is similar to $s[2..4] = \mathbf{000}$;  $\mathbf{000}$ is similar to $s[3..5] = \mathbf{000}$. 

The third test case:   $\mathbf{1}0\mathbf{10}$ is similar to $s[1..4] = \mathbf{1}1\mathbf{10}$;  $\mathbf{1}01\mathbf{0}$ is similar to $s[2..5] = \mathbf{1}10\mathbf{0}$;  $\mathbf{10}1\mathbf{0}$ is similar to $s[3..6] = \mathbf{10}0\mathbf{0}$;  $1\mathbf{0}1\mathbf{0}$ is similar to $s[4..7] = 0\mathbf{0}0\mathbf{0}$. 

The fourth test case:   $0\mathbf{0}$ is similar to $s[1..2] = 1\mathbf{0}$;  $\mathbf{0}0$ is similar to $s[2..3] = \mathbf{0}1$.

Difficulty: EASY
Tags: String algorithms

Constructive algorithms

Starter code:

Solutions:
for _ in range(int(input())):
	n = int(input())
	s = input()
	num = 2 * n - 1
	num = num // 2 + 1
	print(str(s[num - 1]) * n)


import datetime
t = int(input())
for i in range(t):
	n = int(input())
	string = input()
	if n == 1:
		print(string)
	else:
		answer = ''
		for j in range(1, n + 1):
			if j != n:
				temp = string[j - 1:n + j]
				answer += temp[j - 1]
			else:
				temp = string[j - 1:n + j - 1]
				answer += temp[j - 1]
		print(answer)


from sys import stdin, stdout
import math, sys, heapq
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def find_gt(a, x):
	i = bi.bisect_right(a, x)
	if i != len(a):
		return i
	else:
		return -1

def main():
	try:
		n = I()
		l = list(input())
		for x in range(0, 2 * n, 2):
			print(l[x], end='')
		print()
	except:
		pass
M = 998244353
P = 1000000007
Inf = 1000000000000000000
for _ in range(I()):
	main()


t = int(input())
b = []
for _ in range(t):
	n = int(input())
	s = input()
	b = []
	for i in range(len(s)):
		if (i + 1) % 2 != 0:
			b.append(s[i])
	print(''.join(b))


from sys import stdin, stdout
I = stdin.readline
for _ in range(int(I())):
	n = int(I())
	s = I()
	ans = ''
	cnt = 0
	for i in range(n):
		ans += s[i + cnt]
		cnt += 1
	print(ans)


t = int(input())
for _ in range(t):
	(n, s) = (int(input()), input())
	g = [s[i] for i in range(0, len(s), 2)]
	print(*g, sep='')


for t in range(int(input())):
	n = int(input())
	s = input()
	if n == 1:
		print(s)
		continue
	ans = ''
	k = 0
	for i in range(n):
		temp = s[i:i + n]
		ans += temp[k]
		k += 1
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	res = []
	for j in range(n):
		res.append(s[j * 2])
	print(''.join(res))


import sys
input = sys.stdin.buffer.readline
inin = lambda : int(input())
inar = lambda : list(map(int, input().split()))
inst = lambda : input().decode().rstrip('\n\r')
_T_ = inin()
for _t_ in range(_T_):
	n = inin()
	s = 'h' + inst()
	ans = ''
	for i in range(1, n + 1):
		ans += s[i + i - 1]
	print(ans)


t = int(input())
for _ in range(t):
	rs = ''
	n = int(input())
	s = input()
	if s.count('1') == 0 or s.count('0') == 0:
		print(s[:n])
	else:
		for i in range(0, len(s), 2):
			rs = rs + s[i]
		print(rs)


for _ in range(int(input())):
	n = int(input())
	s = input()
	a = s.count('1')
	b = s.count('0')
	if a > b:
		ans = '1' * n
	else:
		ans = '0' * n
	print(ans)


from itertools import permutations
from collections import defaultdict
from math import *
import os
import sys
from io import BytesIO, IOBase
from heapq import nlargest
from bisect import *
import copy
import itertools
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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def counter(s):
	c0 = 0
	c1 = 0
	for i in range(len(s)):
		if s[i] == '0':
			c0 += 1
		else:
			c1 += 1
	if c0 >= c1:
		return True
	else:
		return False

def printer(s):
	for i in range(n):
		print(s, end='')
t = int(input())
while t:
	t -= 1
	n = int(input())
	s = input()
	if counter(s):
		printer('0')
	else:
		printer('1')
	print()


for _ in range(int(input())):
	_ = int(input())
	s = tuple(input())
	print(''.join(s[::2]))


t = int(input(''))
arr = []
for i in range(t):
	int(input(''))
	arr.append(input(''))
for i in arr:
	n = len(i)
	sol = ''
	for j in range(0, n, 2):
		sol += i[j]
	print(sol)


import sys
read = lambda : sys.stdin.readline().strip()
for _ in range(int(read())):
	n = int(read())
	num = read()
	ans = ''
	for i in range(n):
		s = num[i:n + i]
		ans += s[i]
	print(ans)


for _ in range(int(input())):
	ans = ''
	n = int(input())
	s = input()
	for i in range(len(s) - n + 1):
		y = s[i:i + n]
		ans = ans + y[i % n]
	print(ans)


fin = []
n = int(input())
for i in range(n):
	n1 = int(input())
	str0 = input()
	str1 = ''
	for i in range(n1):
		str1 += str0[i * 2]
	fin += [str1]
for s in fin:
	print(s)


for _ in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	for i in range(len(s)):
		if i % 2 == 0:
			if s[i] == '1':
				ans += '1'
			else:
				ans += '0'
	print(ans)


def solve():
	n = int(input())
	s = input()
	ss = s[n - 1] * n
	print(ss)
t = int(input())
while t > 0:
	t -= 1
	solve()


t = int(input())
for i in range(t):
	n = int(input())
	st = input()
	ans = ''
	for i in range(n):
		ans += st[2 * i]
	print(ans)


from sys import stdin, stdout

class SOLVE:

	def solve(self):
		R = stdin.readline
		W = stdout.write
		ans = []
		for i in range(int(R())):
			n = int(R())
			s = R()
			ans.append(s[n - 1] * n)
		W('\n'.join(ans))

def main():
	s = SOLVE()
	s.solve()
main()


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
for i in range(ii()):
	n = ii()
	s = input()
	print(s[n - 1] * n)


n = int(input())
for i in range(n):
	k = int(input())
	s = input()
	r = ''
	for i in range(0, len(s), 2):
		r += s[i]
	print(r)


for i in range(int(input())):
	n = int(input())
	s = input()
	l = []
	for i in range(1, n + 1):
		l.append(s[i - 1:n + i - 1])
	bin = ''
	j = 0
	for i in l:
		bin = bin + i[j]
		j += 1
	print(bin)


MOD = 1000000007
from collections import defaultdict as dd, Counter, deque

def si():
	return input()

def ii():
	return int(input())

def li():
	return list(map(int, input().split()))

def mi():
	return map(int, input().split())

def out(v):
	print(v)

def spout():
	print(v, end=' ')

def d2b(n):
	return bin(n).replace('0b', '')

def twod(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def vow():
	return ['a', 'e', 'i', 'o', 'u']

def let():
	return [chr(i) for i in range(97, 123)]

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def ispow2(x):
	return x and (not x & x - 1)

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return list(factors)
t = ii()
while t:
	t -= 1
	n = ii()
	s = si()
	a = list(s[:n])
	for i in range(len(s) - n + 1):
		f = 0
		for j in range(n):
			if s[i + j] == a[j]:
				f = 1
				break
		if f == 0:
			a[0] = s[i]
	print(''.join(a))


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ans = ''
	for i in range(2 * n - 1):
		if i % 2 == 0:
			ans += s[i]
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	A = list(str(input()))
	B = ''
	for i in range(0, 2 * n, 2):
		B += A[i]
	print(B)


test = int(input())
for t in range(test):
	n = int(input())
	st = input()
	print(st[n - 1] * n)


mod = 10 ** 9 + 7
import sys
for _ in range(int(input())):
	n = int(input())
	arr = input()
	res = ''
	for i in range(0, len(arr), 2):
		res = res + arr[i]
	print(res)


for i in range(int(input())):
	n = int(input())
	s = str(input())
	print(s[0::2])


from math import *
from collections import *
from random import *
from decimal import Decimal
from heapq import *
from bisect import *
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 5)

def lis():
	return list(map(int, input().split()))

def ma():
	return map(int, input().split())

def inp():
	return int(input())

def st1():
	return input().rstrip('\n')
t = inp()
while t:
	t -= 1
	n = inp()
	s = st1()
	r = ''
	for i in range(len(s)):
		if i % 2 == 0:
			r += s[i]
	print(r)


t = int(input())
while t:
	n = int(input())
	s = input()
	l = list(s)
	p = ''
	i = 0
	j = len(l) - 1
	while n:
		p += l[i]
		i += 2
		n -= 1
	print(p)
	t -= 1


for _ in range(int(input())):
	n = int(input())
	s = str(input())
	ans = s[:n]
	count = 0
	for i in range(n):
		for j in range(n):
			if ans[j] == s[i + j]:
				count += 1
				break
	if count == n:
		print(ans)
	else:
		ans = '0' * n
		count = 0
		for i in range(n):
			for j in range(n):
				if ans[j] == s[i + j]:
					count += 1
					break
		if count == n:
			print(ans)
		else:
			print('1' * n)


for _ in range(int(input())):
	_ = input()
	print(''.join([*input()][::2]))


import sys
input = sys.stdin.readline
for i in range(int(input())):
	n = int(input())
	s = input()
	print(s[n - 1] * n)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey, reverse=True)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	for _ in range(ii()):
		n = ii()
		s = si()
		ans = ''
		for i in range(n):
			ans += s[i + i]
		print(ans)
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
i = 0
for i in range(t):
	n = int(input())
	a = input()
	j = 0
	k = 0
	for j in range(n):
		print(a[k], end='')
		k = k + 2
	print('\n')


T = int(input())
for t in range(T):
	n = int(input())
	s = input()
	similar = ''
	for i in range(n):
		sub = s[i:i + n]
		similar = similar + sub[i]
	print(similar)


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	ans = []
	for i in range(n):
		ans.append(s[2 * i])
	print(''.join(ans))


for _ in ' ' * int(input()):
	a = int(input())
	z = input()
	for i in range(0, 2 * a, 2):
		print(z[i], end='')
	print()


for _ in range(int(input())):
	n = int(input())
	s = input()
	a = ''
	for i in range(n):
		a += s[i:n + i][i]
	print(a)


import sys
t = int(input())
i = 0
for line in sys.stdin:
	if i == 0:
		n = int(line)
	else:
		s = line[:-1]
		if len(s) == 1:
			print(s)
		else:
			s2 = []
			for j in range(n):
				s2.append(s[j + j])
			print(''.join(s2))
	i = 1 - i


import sys

def i():
	return sys.stdin.readline()[:-1]
cases = int(i())
for x in range(cases):
	outStr = ''
	i()
	inStr = i()
	outStr = inStr[::2]
	print(outStr)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	stdin = lambda type_='int', sep=' ': list(map(eval(type_), input().split(sep)))
	t = int(input())
	for i in range(t):
		n = int(input())
		string = input()
		if len(string) <= 1:
			print(string)
			continue
		if len(string) == n:
			print(string)
			continue
		prev = string[0:n]
		prevbitsame = [x for x in range(n)]
		for j in range(1, len(string)):
			if n + j <= len(string):
				curr = string[j:n + j]
				k = 0
				same = []
				for (p, c) in zip(prev, curr):
					if p == c:
						same.append(k)
					k += 1
				prevbitsame = [value for value in same if value in prevbitsame]
				prev = curr
			else:
				break
		if prevbitsame == []:
			print('0' * n)
		elif string[prevbitsame[0]] == '0':
			print('0' * prevbitsame[0] + '0' + '0' * (n - prevbitsame[0] - 1))
		else:
			print('0' * prevbitsame[0] + '1' + '0' * (n - prevbitsame[0] - 1))
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for i in range(int(input())):
	n = int(input())
	s = input()
	output = ''
	for i in range(0, 2 * n - 1, 2):
		output += s[i]
	print(output)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	s = list(input().rstrip())
	nList = [0 for i in range(n)]
	for i in range(n):
		num = 1
		for j in range(i, i + n):
			num = num & int(s[j])
		nList[i] = num
	ans = ''
	for i in range(n):
		ans += str(nList[i])
	print(ans)


test = int(input())
for q in range(test):
	n = int(input())
	x = input()
	y = x[n - 1] * n
	print(y)


for _ in range(int(input())):
	n = int(input())
	ar = list(input())
	s = [ar[n - 1] for _ in range(n)]
	print(''.join(s))


t = int(input())
answer = []
for _ in range(t):
	n = int(input())
	string = input()
	nouveau = [0 for i in range(n)]
	answer_tempo = ''
	for i in range(n):
		tempo = 0
		for j in range(n):
			tempo += int(string[j + i])
		nouveau[i] = tempo
	for i in range(n):
		if nouveau[i] == n:
			answer_tempo += '1'
		else:
			answer_tempo += '0'
	answer.append(answer_tempo)
print('\n'.join(answer))


for _ in range(int(input())):
	n = int(input())
	s = list(input())
	a = 0
	b = 0
	for i in range(len(s) - n + 1):
		l = ''
		for j in range(i, i + n):
			l += s[j]
		if l.count('0') >= 1:
			a += 1
		if l.count('1') >= 1:
			b += 1
	if len(s) - n + 1 == a:
		print('0' * n)
	elif len(s) - n + 1 == b:
		print('1' * n)
	else:
		print('0' * n)


import os
import sys
from io import BytesIO, IOBase

def main():
	pass
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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def count1(s):
	c = 0
	for i in s:
		if i == '1':
			c += 1
	return c

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def countcon(i):
	n = 1
	i += 1
	c = s[i - 1]
	while i < len(s):
		if s[i] != c:
			break
		else:
			n += 1
			i += 1
	return n
for xyz in range(0, int(input())):
	n = int(input())
	s = input()
	ans = ''
	i = 0
	maxcon0 = 0
	maxcon1 = 0
	while i < n:
		if s[i] == '1':
			t = countcon(i)
			maxcon1 = max(maxcon1, t)
			i += t
		else:
			t = countcon(i)
			maxcon0 = max(maxcon0, t)
			i += t
	if maxcon1 >= maxcon0:
		print('1' * n)
	else:
		print('0' * n)


from sys import stdin
T = int(stdin.readline().strip())
for caso in range(T):
	n = int(stdin.readline().strip())
	s = stdin.readline().strip()
	x = s.count('0')
	y = s.count('1')
	if x > y:
		ans = '0' * n
	else:
		ans = '1' * n
	print(ans)


def controller(n, s):
	b = 0
	a = max_val = (1 << n) - 1
	partial = int(s[:n], base=2)
	excludes = {max_val - partial}
	i = 0
	pow2 = 1 << n - 1
	for i in range(n, 2 * n - 1):
		if pow2 < partial:
			partial -= pow2
		partial = (partial << 1) + (s[i] == '1')
		excludes.add(max_val - partial)
	for x in range(0, n + 1):
		if x not in excludes:
			return ('{:0%sb}' % n).format(x)

def c_in():
	n_test_case = int(input())
	for i in range(n_test_case):
		n = int(input())
		s = input().rstrip()
		print(controller(n, s))
c_in()


def get_inverter(n):
	max = (1 << n) - 1

	def inv(x):
		return max - x
	return inv

def controller(n, s):
	b = 0
	a = max_val = (1 << n) - 1
	excludes = [max_val - int(s[i:i + n], base=2) for i in range(n)]
	for x in excludes:
		if a > x:
			a = x
		if b < x:
			b = x
	if a > 0:
		return '0' * n
	if b < max_val:
		return '1' * n
	excludes = set(excludes)
	for x in range(1, n):
		if x not in excludes:
			return ('{:0%sb}' % n).format(x)
	return excludes

def c_in():
	try:
		import sys
		sys.stdin = open(sys.argv[0] + '/../in-a.txt')
	except:
		pass
	n_test_case = int(input())
	for i in range(n_test_case):
		n = int(input())
		s = input().rstrip()
		print(controller(n, s))
c_in()


t = int(input())
while t:
	t -= 1
	n = int(input())
	s = input()
	r = s[::2]
	print(r)


import sys
T = int(sys.stdin.readline())
for _ in range(T):
	n = int(sys.stdin.readline())
	s = sys.stdin.readline().strip()
	print(s[n - 1] * n)


for _ in range(int(input())):
	n = int(input())
	s = list(input())
	ans = ''
	j = 0
	for i in range(0, n):
		l = s[i:n + i]
		ans = ans + l[j]
		j = j + 1
	print(ans)


import sys
t = int(sys.stdin.readline())
for num in range(t):
	n = int(sys.stdin.readline())
	s = sys.stdin.readline()
	ls = []
	for num in range(n):
		ls.append(s[num:num + n])
	answer = ''
	for num in ls:
		answer += num[ls.index(num)]
	print(answer)


T = int(input())
for i in range(T):
	n = int(input())
	s = input()
	x = ''
	c = ''
	c += s[n - 1]
	for i in range(n):
		x += c
	print(x)


for _ in range(int(input())):
	n = int(input())
	s = list(input())
	c = s[n - 1]
	for i in range(n):
		print(c, end='')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	r = ''
	for i in range(0, 2 * n - 1, 2):
		r += s[i]
	print(r)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	k = s[n - 1]
	print(k * n)


t = int(input())
for i in range(t):
	n = int(input())
	s = [i for i in input()]
	a0 = ['0' for i in range(n)]
	a1 = ['1' for i in range(n)]
	b = []
	for j in range(n):
		b.append(s[j:j + n])
	if a1 in b:
		r = []
		for k in range(len(b)):
			r.append(set([i for i in range(len(b[k])) if b[k][i] == '1']))
		temp = set([i for i in range(n)])
		for l in r:
			temp = temp.intersection(l)
		a0[list(temp)[0]] = '1'
		print(''.join(a0))
	else:
		print(''.join(a0))


def solver(n, stroka):
	a_int = []
	for k in range(len(stroka)):
		a_int.append(int(stroka[k]))
	mat = []
	for k in range(n):
		mat.append(a_int[k:k + n])
	res = ''
	cur_bad = set([i for i in range(n)])
	for pos in range(n):
		col = mat[:][pos]
		good_0 = set()
		good_1 = set()
		for k in range(n):
			if col[k] == 0:
				good_0.add(k)
			else:
				good_1.add(k)
		var_0 = cur_bad.intersection(good_0)
		var_1 = cur_bad.intersection(good_1)
		if len(var_0) >= len(var_1):
			res += '0'
			cur_bad = cur_bad.difference(var_0)
		else:
			res += '1'
			cur_bad = cur_bad.difference(var_1)
		if len(cur_bad) == 0:
			for k in range(n - len(res)):
				res += '0'
			break
	return res
answers = []
n_case = int(input())
for k in range(n_case):
	n_case = int(input())
	stroka = input()
	answers.append(solver(n_case, stroka))
for ans in answers:
	print(ans)


t = int(input())
while t:
	t -= 1
	n = int(input())
	s = input()
	ans = ''
	for i in range(n - 1):
		ans += s[i + i]
	ans += s[-1]
	print(ans)


testcases = int(input())
set = []
for i in range(testcases):
	input()
	s = str(input())
	set.append(s)

def stringer(inp):
	a = ''
	for i in range(1, int((len(inp) + 1) / 2) + 1):
		b = inp[2 * i - 2]
		a += b
	return a
for i in set:
	print(stringer(i))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def main():
	t = I()
	rr = []
	for _ in range(t):
		n = I()
		s = S()
		r = s[::2]
		rr.append(r)
	return JA(rr, '\n')
print(main())


for _ in range(int(input())):
	n = int(input())
	a = list(input())
	print(''.join(a[::2]))


t = int(input())
for _ in range(t):
	n = int(input())
	arr = input()
	ans = ''
	for i in range(0, 2 * n - 1, 2):
		ans += arr[i]
	print(ans)


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 19
MOD = 10 ** 9 + 7
for _ in range(INT()):
	N = INT()
	S = input()
	x = S[N - 1]
	ans = x * N
	print(ans)


for _ in range(int(input())):
	n = int(input())
	binStr = input()
	k = 0
	st = ''
	for i in range(n):
		st += binStr[i + k]
		k += 1
	print(st)


def make(n, s):
	r = ''
	for x in range(len(s)):
		if x % 2 == 0:
			r += s[x]
	return r
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	r = make(n, s)
	print(r)


import sys
input = sys.stdin.readline
t = int(input().strip())
inputs = []
for i in range(0, t):
	n = int(input().strip())
	s = input()
	inputs.append([n, s])
for i in range(0, t):
	n = inputs[i][0]
	s = inputs[i][1]
	similar = s[0]
	for j in range(1, n):
		has_similar = False
		last_letter_to_traverse = j + len(similar)
		pos = j
		while pos < last_letter_to_traverse and (not has_similar):
			if s[pos] == similar[pos - j]:
				has_similar = True
			else:
				pos += 1
		if not has_similar and len(similar) < n:
			similar += s[pos]
	while len(similar) < n:
		similar += '0'
	print(similar)


for _ in range(int(input())):
	n = int(input())
	a = input()
	print(a[0::2])


T = int(input())
while T:
	n = int(input())
	s = input()
	result = ''
	if n == 1:
		print(s)
	elif n == 2:
		result = s[1] * 2
		print(result)
	else:
		for i in range(n):
			result += s[2 * i]
		print(result)
	T -= 1


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		s = str(input())
		print(s[n - 1] * n)
main()


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	c = s[n - 1]
	print(c * n)


for _ in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	l = n - 1
	for i in range(n):
		ans += s[l]
	print(ans)


import sys
t = int(input())
for i in range(t):
	n = int(input())
	s = input().strip()
	a = ''
	for j in range(0, 2 * n - 1, 2):
		a = a + s[j]
	print(a)


t = int(input())
input_lis = []
for i in range(t):
	n = int(input())
	s = input()
	input_lis.append([n, s])
for item in input_lis:
	output_str = ''
	n = item[0]
	s = item[1]
	for i in range(0, 2 * n - 1, 2):
		output_str += s[i]
	print(output_str)
	output_str = ''


from collections import *
import sys

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))
t = ri()
for _ in range(t):
	n = ri()
	ss = input()
	w = ss[n - 1] * n
	print(w)


def main():
	n = int(input())
	s = input()
	res = ''
	for i in range(n):
		res += s[i * 2]
	print(res)
for _ in range(int(input())):
	main()


testcases = input()
for _ in range(int(testcases)):
	n = int(input())
	s = input()
	print(s[n - 1] * n)


t = int(input())
for _ in range(t):
	n = int(input())
	j = input()
	print(j[n - 1] * n)


t = int(input())
nLst = []
ansLst = []
for tt in range(t):
	n = int(input())
	s = input()
	strArr = []
	nCount = n
	for i in range(n):
		strArr.append(s[i:nCount])
		nCount += 1
	(zeroPoint, onePoint) = (False, False)
	for i in range(len(strArr)):
		(zeroCount, oneCount) = (0, 0)
		for j in range(len(strArr[i])):
			if strArr[j][i] == '0':
				zeroCount += 1
			else:
				oneCount += 1
		if zeroCount == len(strArr):
			zeroPoint = True
			break
		elif oneCount == len(strArr):
			onePoint = True
			break
	ans = ''
	if zeroPoint == True:
		for x in range(len(strArr)):
			ans += '0'
	elif onePoint == True:
		for x in range(len(strArr)):
			ans += '1'
	else:
		for x in range(len(strArr)):
			ans += '0'
	ansLst.append(ans)
for i in ansLst:
	print(i)


import sys
T = int(input())
for _ in range(T):
	n = int(input())
	s = input()
	w = ''
	for i in range(0, 2 * n - 1, 2):
		w = w + s[i]
	print(w)


for _ in range(int(input())):
	n = int(input())
	s = list(input())
	l = []
	ll = []
	for i in range(n):
		l.append(s[i:i + n])
	for i in range(n):
		a = 0
		for j in range(n):
			a = a or int(l[j][i])
		ll.append(str(a))
	print(''.join(ll))


for s in [*open(0)][2::2]:
	print(s[::2])


t = int(input())
for i in range(0, t):
	n = int(input())
	s = input()
	something = 2 * n - 1
	result = ''
	for j in range(0, something, 2):
		result += s[j]
	print(result)


import sys
input = sys.stdin.readline

def print(val):
	sys.stdout.write(val + '\n')

def prog():
	for _ in range(int(input())):
		n = int(input())
		s = input().strip()
		print(s[n - 1] * n)
prog()


for _ in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	for z in range(0, 2 * n - 1, 2):
		ans += s[z]
	print(ans)


t = int(input())
answer = []
for i in range(t):
	n = int(input())
	s = input()
	count = 0
	for num in s:
		if num == '0':
			count += 1
	if count >= n:
		answer.append('0' * n)
	else:
		answer.append('1' * n)
for string in answer:
	print(string)


t = int(input())
for _ in range(t):
	n = int(input())
	x = input()
	list1 = list(x.strip())
	ele = list1[n - 1]
	for i in range(n):
		print(ele, end='')
	print()


t = int(input())
while t:
	n = int(input())
	s = input().strip()
	strr = ''
	for i in range(len(s)):
		if i % 2 == 0:
			strr += s[i]
	print(strr)
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	arr = []
	for ch in s:
		arr.append(int(ch))
	ans = ''
	for end in range(0, n):
		subArr = arr[end:n + end]
		if 1 in subArr:
			ans += '1'
		else:
			ans += '0'
	print(ans)


for _ in range(int(input())):
	n = int(input())
	s = input()
	arr = []
	for item in s:
		if item != '\r':
			arr.append(item)
	x = 2 * n - 1
	ans = ''
	count = 0
	for i in range(n):
		count = count + 1
		r = arr[i:i + n][i]
		ans = ans + str(r)
	print(ans)


for _ in range(int(input())):
	n = int(input())
	s = input()
	c = s[n - 1]
	ans = ''
	ans += c * n
	print(ans)


def solve(n, s):
	ans = ''
	for i in range(0, 2 * n - 1, 2):
		ans += s[i]
	return ans
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	print(solve(n, s))


for _ in range(int(input())):
	n = int(input())
	s = input()
	res = ''
	for i in range(0, len(s), 2):
		res += s[i]
	print(res)


we = int(input())
for wewe in range(we):
	n = int(input())
	s = input()
	q = s[0:2 * n - 1:2]
	print(q)


for _ in range(int(input())):
	n = int(input())
	s = str(input())
	ans = ''
	for i in range(0, 2 * n - 1, 2):
		ans += s[i]
	print(ans)


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
from collections import *
for _ in range(ii()):
	n = ii()
	a = si()
	if a.count('1') <= a.count('0'):
		print('0' * n)
	else:
		print('1' * n)


q = int(input())
for _ in range(q):
	n = int(input())
	s = input()
	d = []
	for i in range(n):
		d.append(s[2 * i])
	print(''.join(d))


for iih in range(int(input())):
	n = int(input())
	s = input()
	l = ''
	for i in range(n):
		l += s[2 * i]
	print(l)


for i in range(int(input())):
	n = int(input())
	st = input()
	for i in range(0, 2 * n - 1, 2):
		print(st[i], end='')
	print('')


t = int(input())
for _ in range(t):
	n = int(input())
	x = str(input())
	ans = ''
	for i in range(0, 2 * n - 1, 2):
		ans += x[i]
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input().rstrip())
	s = input().rstrip()
	ans = ''
	i = 0
	while i < len(s):
		ans += s[i]
		i += 2
	print(ans)


for i in range(int(input())):
	n = int(input())
	k = input()
	k = list(k)
	if k[n - 1] == '1':
		print('1' * n)
	else:
		print('0' * n)


from sys import *
ws = lambda : map(int, stdin.readline().strip().split())
li = lambda : list(map(int, stdin.readline().strip().split()))
mod = 1000000007

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def prod(l):
	ans = 1
	for i in range(len(l)):
		ans = ans * l[i]
	return ans
for testcases in range(int(input())):
	num = int(input())
	c = input()
	for i in range(num):
		print(c[2 * i], end='')
	print()


for _ in range(int(input())):
	n = int(input())
	s = input()
	c = []
	for i in range(len(s)):
		if i % 2 == 0:
			c += s[i]
	str = ''
	for e in c:
		str += e
	print(str)


for _ in range(int(input())):
	n = int(input())
	s = input()
	mat = [['0', 'UM'] for i in range(n)]
	for i in range(n):
		p = 0
		for j in range(i, i + n):
			if mat[p][0] != s[j]:
				if mat[p][1] == 'UM':
					mat[p][0] = s[j]
					mat[p][1] = 'M'
					break
			p += 1
	ans = ''
	for i in mat:
		ans += i[0]
	print(ans)


for case in range(int(input())):
	n = int(input())
	s = input()
	ans = []
	for i in range(0, 2 * n - 1, 2):
		ans.append(s[i])
	print(''.join(ans))


t = int(input())
for _ in range(t):
	rs = ''
	n = int(input())
	s = input()
	for i in range(0, len(s), 2):
		rs = rs + s[i]
	print(rs)


n = int(input())
for l in range(n):
	s = int(input())
	t = []
	f = s
	k = input()
	for i in range(s):
		li = []
		for j in range(i, s):
			li.append(k[j])
		t.append(li[i])
		s += 1
	for m in range(f):
		print(t[m], end='')
	print()


t = int(input())
while t > 0:
	n = int(input())
	s = str(input())
	final = 0
	for i in range(n):
		s1 = s[i:i + n]
		s2 = '1' + s1 + '1'
		final = final + int(s2)
	s3 = ''
	final = list(str(final))
	for i in range(1, n + 1):
		if final[i] == 'n':
			s3 = s3 + '1'
		elif final[i] == '0':
			s3 = s3 + '0'
		else:
			s3 = s3 + '1'
	print(s3)
	t = t - 1


a = int(input())
for i in range(0, a):
	b = int(input())
	s = input()
	one = 0
	zero = 0
	for i in s:
		if i == '1':
			one = one + 1
		else:
			zero = zero + 1
	if one > zero:
		ans = ['1'] * b
		print(''.join(map(str, ans)))
	else:
		ans = ['0'] * b
		print(''.join(map(str, ans)))


import random
import os
for T in range(int(input())):
	n = int(input())
	s = input()
	while True:
		ans = ''.join((random.choice('01') for _ in range(n)))
		is_valid = True
		for i in range(0, n):
			for j in range(0, n):
				if s[i + j] == ans[j]:
					break
			else:
				is_valid = False
				break
		if is_valid == True:
			print(ans)
			break


def result():
	n = int(input())
	str = input()
	new_str = ''
	for i in range(n):
		new_str += str[2 * i]
	print(new_str)
test = int(input())
while test > 0:
	result()
	test = test - 1


def run():
	n = int(input())
	myst = input()
	ans = ''
	for i in range(n):
		ans += myst[2 * i]
	print(ans)
for i in range(int(input())):
	run()


for _ in range(int(input())):
	n = int(input())
	s1 = list(str(input()))
	print(s1[n - 1] * n)


a = int(input())
for i in range(0, a):
	b = int(input())
	c = list(map(int, input()))
	d = c.count(0)
	e = c.count(1)
	f = ''
	for j in range(0, b):
		f += str(0)
	g = ''
	for k in range(0, b):
		g += str(1)
	if d > e:
		print(f)
	elif e > d:
		print(g)
	else:
		print(f)


import math, sys, bisect, heapq
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))
from functools import lru_cache

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])
A = '10' * 100
B = '01' * 100
C = '0' * 100
D = '1' * 100
for _ in range(int(input())):
	N = int(input())
	S = input()
	l = len(S)
	a = A[:N]
	f = 0
	for i in range(l - N + 1):
		T = S[i:i + N]
		g = 0
		for j in range(N):
			if T[j] == a[j]:
				g = 1
				break
		if g == 0:
			f = 1
			break
	if f == 0:
		print(a)
	else:
		a = B[:N]
		f = 0
		for i in range(l - N + 1):
			T = S[i:i + N]
			g = 0
			for j in range(N):
				if T[j] == a[j]:
					g = 1
					break
			if g == 0:
				f = 1
				break
		if f == 0:
			print(a)
		else:
			a = C[:N]
			f = 0
			for i in range(l - N + 1):
				T = S[i:i + N]
				g = 0
				for j in range(N):
					if T[j] == a[j]:
						g = 1
						break
				if g == 0:
					f = 1
					break
			if f == 0:
				print(a)
			else:
				print(D[:N])


t = int(input())
for i in range(t):
	n = int(input())
	a = input()
	ans = []
	for i in range(n):
		b = a[i:n + i]
		ans.append(b[i])
	print(''.join(map(str, ans)))


for t in range(int(input())):
	n = int(input())
	s = input()
	one = 0
	zero = 0
	for i in s:
		if i == '1':
			one += 1
	zero = len(s) - one
	if one > zero:
		for i in range(n):
			print('1', end='')
	else:
		for i in range(n):
			print('0', end='')
	print()


tests = int(input())
for _ in range(tests):
	n = int(input())
	s = input()
	print(n * s[n - 1])


t = int(input())
res = []
for i in range(t):
	n = int(input())
	s = input()
	r = ['1'] * n
	for i in range(n):
		against = s[i:i + n]
		for j in range(n):
			if r[j] == '1' and against[j] == '1':
				r[j] = '1'
			else:
				r[j] = '0'
	res.append(''.join(r))
print('\n'.join(res))


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
for _ in range(int(input())):
	n = int(input())
	s = input()
	p = s[:n]
	for x in range(n, 2 * n - 1):
		(k, ok) = (s[x - n + 1:x + 1], 0)
		for y in range(n):
			if p[y] == k[y]:
				ok = 1
				break
		if not ok:
			a = list(p)
			a[0] = k[0]
			p = ''.join(a)
	print(p)


t = int(input())
while t:
	t = t - 1
	n = int(input())
	s = input()
	ans = ''
	for w in range(0, len(s), 2):
		ans += s[w]
	print(ans)


from math import ceil, sqrt

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		s = input()
		answer = []
		for i in range(n):
			if s[i * 2] == '0':
				answer.append(0)
			else:
				answer.append(1)
		print(*answer, sep='')
main()


for _ in range(int(input())):
	n = int(input())
	s = input()
	r = ''
	for i in range(len(s)):
		if i % 2 == 0:
			r += s[i]
	print(r)


t = int(input())
for you in range(t):
	n = int(input())
	s = input()
	z = ''
	for i in range(0, 2 * n - 1, 2):
		z = z + s[i]
	print(z)


for _ in range(int(input())):
	n = int(input())
	s = input()
	a = s[n - 1] * n
	print(a)


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	for i in range(0, len(s), 2):
		print(s[i], end='')
	print('')


import sys
input = sys.stdin.readline
t = int(input())
for tt in range(t):
	n = int(input())
	s = str(input())
	(c1, c0) = (0, 0)
	for i in range(len(s)):
		if s[i] == '0':
			c0 += 1
		else:
			c1 += 1
	if c1 > c0:
		print('1' * n)
	else:
		print('0' * n)


t = int(input())
for _ in range(t):
	n = int(input())
	a = input()
	if n == 1:
		print(a[0])
	else:
		d = ''
		for i in range(0, len(a), 2):
			d += a[i]
		print(d)


def split(ini):
	return [c for c in ini]
i = int(input())
for _ in range(i):
	k = int(input())
	j = [int(l) for l in split(input())][k - 1]
	for _ in range(k):
		print(j, end='')
	print()


t = int(input())
while t:
	t = t - 1
	n = int(input())
	s = input()
	ss = ''
	for i in range(0, len(s), 2):
		ss += s[i]
	print(ss)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	t3 = s[n - 1] * n
	print(t3)


def solution(n, s):
	ans = []
	a = 0
	for i in range(n):
		ans.append(s[i + a])
		a += 1
	return ''.join(ans)
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	print(solution(n, s))


for _ in range(int(input())):
	n = int(input())
	s = input()
	s = list(s)
	ans = []
	for i in range(n):
		j = i + (n - 1)
		t = ''
		for k in range(i, i + n):
			t += s[k]
		ans.append(t)
	c = ''
	for i in range(n):
		c += ans[i][i]
	print(c)


for tests in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	for i in range(n):
		ans += s[i]
		s = s[1:]
	print(ans)


import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def main():
	for _ in range(r()):
		n = r()
		a = input()
		b = ''
		for i in range(2 * n - 1):
			if i % 2:
				continue
			b += a[i]
		print(b)
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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def r():
	return int(input())

def rm():
	return map(int, input().split())

def rl():
	return list(map(int, input().split()))
main()


t = int(input())
while t:
	n = int(input())
	s = input()
	y = ''
	if len(s) == 2 * n - 1:
		for _ in range(n):
			y = y + s[n - 1]
		for i in range(n):
			x = s[i:n + i]
			if y == x:
				continue
		print(y)
	t -= 1


t = int(input())
while t:
	t -= 1
	n = int(input())
	s = input()
	lst = [s[n - 1]] * n
	res = ''.join(lst)
	print(res)


for t in range(int(input())):
	n = int(input())
	string = list(input())
	initial = [1] * n
	index = 0
	for i in range(n):
		start = i
		end = n + i
		sub_string = string[start:end]
		for j in range(index, n):
			if sub_string[j] == initial[j]:
				break
			else:
				initial[j] = sub_string[j]
				break
		index += 1
	print(*initial, sep='')


for _ in range(int(input())):
	n = int(input())
	s = input()
	for i in range(n):
		print(s[2 * i], end='')
	print()


import sys
import math

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def solve(n):
	return n % 9

def main():
	n = int(input())
	s = input()
	res = ''
	for i in range(0, len(s), 2):
		res += s[i]
	print(res)
t = int(input())
for i in range(t):
	main()


for _ in range(int(input())):
	n = int(input())
	s = input()
	ans = []
	for i in range(n):
		ans.append(s[2 * i])
	print(*ans, sep='')


t = int(input())
answers = [''] * t
for i in range(t):
	n = int(input())
	string = input()
	if string[n - 1] == '0':
		for j in range(n):
			answers[i] += '0'
	elif string[n - 1] == '1':
		for j in range(n):
			answers[i] += '1'
for i in range(t):
	print(answers[i])


t = int(input())
for x in range(t):
	n = int(input())
	s = input()
	print(s[n - 1] * n)


t = int(input())
for i in range(t):
	n = int(input())
	a = input()
	b = ''
	for j in range(0, len(a), 2):
		b += a[j]
	print(b)


for _ in range(int(input())):
	n = int(input())
	y = input()
	for i in range(0, len(y), 2):
		if n == 0:
			break
		n -= 1
		print(y[i], end='')
	print()


for i in range(int(input())):
	s1 = ''
	s2 = ''
	n = int(input())
	s = input()[:2 * n - 1]
	for i in range(0, n):
		s1 = s[i:n + i + 1]
		s2 = s2 + s1[0 + i:i + 1]
	print(s2)


for _ in range(int(input())):
	n = int(input())
	b = input()
	x = ''
	if b[n - 1] == '0':
		for i in range(n):
			x = x + '0'
	else:
		for i in range(n):
			x = x + '1'
	print(x)


t = int(input())
for tt in range(t):
	n = int(input())
	s = input()
	a = s[n - 1] * n
	print(a)


for _ in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	while len(ans) < n:
		ans += s[len(ans):][len(ans)]
	print(ans)


import sys, math
from collections import deque, defaultdict
import operator as op
from functools import reduce
sys.setrecursionlimit(10 ** 6)
I = sys.stdin.readline

def ii():
	return int(I().strip())

def li():
	return list(map(int, I().strip().split()))

def mi():
	return map(int, I().strip().split())

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def solve(n, p):
	if n < 1:
		return 0
	elif n == 1:
		return 1
	return solve(n - 1, n) + solve(n - 3, n) + solve(n - 5, n)

def main():
	ans = ''
	for _ in range(ii()):
		n = ii()
		s = I()
		ans += s[n - 1] * n + '\n'
	print(ans)
main()


for _ in range(int(input())):
	n = int(input())
	s = input()
	l = 0
	i = 0
	ff = []
	while i < n:
		ff.append(s[l])
		l += 2
		i += 1
	print(''.join(ff))


from sys import *
times = int(input())
for i in range(times):
	n = int(input())
	bint = input().strip()
	test = bint[0:n]
	for j in range(1, n):
		hmm = bint[j:j + n]
		j = ''
		for k in range(0, n):
			if hmm[k] == '1' and test[k] == '1':
				j += '1'
			else:
				j += '0'
		test = j
	print(test)


T = int(input())
for z in range(T):
	n = int(input())
	s = input()
	out = ''
	for i in range(2 * n - 1):
		if i % 2 == 0:
			out = out + s[i]
	print(out)


T = int(input())
for _ in range(0, T):
	n = int(input())
	s = input()
	kk = s[n - 1]
	ans = kk * n
	print(ans)


for _ in range(int(input())):
	n = int(input())
	a = input()
	t = a[n - 1] * n
	print(t)


def similar(s, p):
	if str(int(s) + int(p)).count('1') == len(s):
		return False
	else:
		return True
for _ in ' ' * int(input()):
	a = int(input())
	b = input()
	for i in range(2 ** a):
		p = bin(i)
		q = p[2:].zfill(a)
		if all((similar(q, b[j:j + a]) for j in range(a))) == True:
			print(q)
			break


test = int(input())
while test > 0:
	n = int(input())
	s = input()
	c1 = 0
	c0 = 0
	for i in s:
		if i == '1':
			c1 += 1
		else:
			c0 += 1
	if c1 >= c0:
		print('1' * n)
	else:
		print('0' * n)
	test -= 1


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	c0 = s.count('0')
	c1 = s.count('1')
	if c0 > c1:
		print('0' * n)
	else:
		print('1' * n)


import sys, io, os, time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect, math, heapq
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for ii in range(int(input())):
	n = int(input())
	s = input()
	offset = 0
	for i in range(0, n):
		print(s[i + offset], end='')
		offset += 1
	print()


t = int(input())
output = []
for i in range(t):
	n = int(input())
	s = input()
	sub = []
	w = ''
	for j in range(n):
		sub.append(s[j:j + n])
	for j in range(len(sub)):
		w += sub[j][j]
	output.append(w)
for i in range(len(output)):
	print(output[i])


from collections import Counter
t = int(input())
for _ in range(t):
	n = int(input())
	str = list(input())
	if n == 1:
		print(''.join(str))
		continue
	str_c = Counter(str)
	if str_c['1'] > str_c['0']:
		print(''.join(['1' for i in range(n)]))
	else:
		print(''.join(['0' for i in range(n)]))


t = int(input())
while t:
	t -= 1
	n = int(input())
	s = input()
	mid = (len(s) - 1) // 2
	for i in range(n):
		print(s[mid], end='')
	print()


t = int(input())
for _ in range(t):
	_ = int(input())
	line = input()
	line = line[::2]
	print(line)


import sys

class StringSimilarity:
	pass
test_cases = int(sys.stdin.readline())
for t in range(test_cases):
	n = int(sys.stdin.readline())
	s = sys.stdin.readline()
	middle = s[n - 1]
	similar_string = ''
	for c in range(n):
		similar_string += middle
	print(similar_string)


import math
for i in range(int(input())):
	n = int(input())
	s = str(input())
	a = ''
	for i in range(0, len(s), 2):
		a += s[i]
	print(a)


def string_sim(n, num):
	ans = ''
	zero = set([i for i in range(n) if num[i] == '0'])
	for i in range(len(num) - n + 1):
		my_str = num[i:i + n]
		zeros = set([j for j in range(n) if my_str[j] == '0'])
		zero = zeros & zero
	if len(list(zero)) == 0:
		for j in range(n):
			ans += '1'
	else:
		for j in range(n):
			ans += '0'
	return ans
test = int(input())
for i in range(test):
	n = int(input())
	num = input()
	print(string_sim(n, num))


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	n = len(s)
	ans = ''
	print(''.join((s[i] for i in range(0, n, 2))))


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	print(s[::2])


tc = int(input())
for t in range(tc):
	n = int(input())
	s = input()
	res = ''
	c1 = 0
	c2 = 0
	for i in s:
		if i == '1':
			c1 += 1
		else:
			c2 += 1
	if c1 > c2:
		c = '1'
	else:
		c = '0'
	for i in range(n):
		res += c
	print(res)


from sys import stdin, stdout
num = int(stdin.readline())

def main():
	for _ in range(0, num):
		m = int(stdin.readline())
		n = stdin.readline()
		print(n[m - 1] * m)
main()


def solve(lst, n):
	build = []
	for i in range(n):
		build.append(lst[2 * i])
	return ''.join(build)
test_cases = int(input())
for i in range(test_cases):
	n = int(input())
	lst = [char for char in input()]
	res = solve(lst, n)
	print(res)


test = int(input())
for t in range(test):
	n = int(input())
	s = input()
	count1 = 0
	count2 = 0
	for i in s:
		if i == '0':
			count1 = count1 + 1
		else:
			count2 = count2 + 1
	if count1 >= count2:
		for x in range(n):
			print(0, end='')
	else:
		for y in range(n):
			print(1, end='')
	print('')


import sys
import heapq, functools, collections
import math, random
from collections import Counter, defaultdict

def solve(strr, k):
	console('----- solving ------')
	console(strr)
	return strr[::2]

def console(*args):
	print('\x1b[36m', *args, '\x1b[0m', file=sys.stderr)
	return
for case_num in range(int(input())):
	k = int(input())
	strr = input()
	res = solve(strr, k)
	print(res)


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(t,) = I()
for _ in range(t):
	(n,) = I()
	s = input().strip()
	an = s[n - 1] * n
	print(an)


b = int(input())
for _ in range(b):
	a = int(input())
	c = str(input())
	d = str('')
	e = 0
	while e < 2 * a:
		d = d + c[e]
		e += 2
	print(d)
	d = ''


import sys, random
input = sys.stdin.readline

def test():
	n = int(input())
	s = input()
	k = ''
	i = 0
	j = n
	win = 0
	while win < n:
		k += s[i:j][win]
		i += 1
		j += 1
		win += 1
	return k
t = int(input())
for _ in range(t):
	print(test())


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	print(s[::2])


for _ in range(int(input())):
	n = int(input())
	print(input()[n - 1] * n)


for _ in range(int(input())):
	n = int(input())
	s = str(input())
	print(s[n - 1] * n)


t = int(input())
ans = []
for i in range(t):
	n = int(input())
	c = input()[n - 1]
	ans += [c * n]
for x in ans:
	print(x)


def recurs_Foo(a, n):
	if n > 2:
		summ_ind = a[0] + a[n - 2]
		if summ_ind < a[-1]:
			return summ_ind + recurs_Foo(a[1:n - 2] + [summ_ind] + [a[n - 1]], n - 1)
		else:
			return summ_ind + recurs_Foo(a[1:n - 2] + [a[n - 1]] + [summ_ind], n - 1)
	return sum(a)

def Close_s(n, s):
	close_s = ''
	for i in range(n):
		close_s += s[i * 2]
	return close_s
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	print(s[0:2 * n:2])


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	result = ''
	for (i, c) in enumerate(s):
		if i % 2 == 0:
			result += c
	print(result)


import sys

def parser():
	while 1:
		data = list(input().split(' '))
		for number in data:
			if len(number) > 0:
				yield number
input_parser = parser()

def get_word():
	global input_parser
	return next(input_parser)

def get_number():
	data = get_word()
	try:
		return int(data)
	except ValueError:
		return float(data)

def generate_word(n, long_word):
	target = ''
	counter = 0
	while n != 0:
		target = target + long_word[counter]
		long_word = long_word[1:]
		n = n - 1
		counter = counter + 1
	print(target)
test_cases = get_number()
for i in range(0, test_cases):
	n = get_number()
	long_word = get_word()
	generate_word(n, long_word)


T = int(input())
for _ in range(T):
	n = int(input())
	nums = list(input())
	print(''.join(nums[::2]))


n = int(input())
for i in range(n):
	x = int(input())
	s = input()
	print(s[::2])


from sys import stdin

def main():
	input = lambda : stdin.readline()[:-1]
	T = int(input())
	for _ in [0] * T:
		N = int(input())
		S = input()
		ans = S[N - 1] * N
		print(ans)
main()


for _ in range(int(input())):
	n = int(input())
	s = input()
	res = s[::2]
	print(res)


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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import gcd, ceil

def pre(s):
	n = len(s)
	pi = [0] * n
	for i in range(1, n):
		j = pi[i - 1]
		while j and s[i] != s[j]:
			j = pi[j - 1]
		if s[i] == s[j]:
			j += 1
		pi[i] = j
	return pi

def prod(a):
	ans = 1
	for each in a:
		ans = ans * each
	return ans

def lcm(a, b):
	return a * b // gcd(a, b)

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
for _ in range(int(input()) if True else 1):
	n = int(input())
	s = input()
	ans = [''] * n
	for i in range(n):
		ans[i] = s[i + i]
	print(*ans, sep='')


import sys
MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.141592653589793

def read_str():
	return sys.stdin.readline().strip()

def read_int():
	return int(sys.stdin.readline().strip())

def read_ints():
	return map(int, sys.stdin.readline().strip().split())

def read_ints2(x):
	return map(lambda num: int(num) - x, sys.stdin.readline().strip().split())

def read_str_list():
	return list(sys.stdin.readline().strip().split())

def read_int_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def GCD(a: int, b: int) -> int:
	return b if a % b == 0 else GCD(b, a % b)

def LCM(a: int, b: int) -> int:
	return a * b // GCD(a, b)

def Main():
	for _ in range(read_int()):
		n = read_int()
		s = read_str()
		print(s[0::2])
Main()


t = int(input())
for _ in range(t):
	n = int(input())
	l = input()
	for i in range(0, 2 * n - 1, 2):
		print(l[i], end='')
	print()


for _ in range(int(input())):
	n = int(input())
	s = list(input())
	f = 0
	for i in range(n):
		a = s[i:i + n]
		if len(list(set(a))) == 1:
			for k in a:
				print(k, end='')
			f = 1
			break
	if f == 0:
		for j in range(n):
			print('0', end='')
	print()


import sys
input = sys.stdin.readline
import heapq
import copy
import math
import decimal

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def insr2():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())

def pr_list(a):
	print(*a, sep=' ')

def main():
	tests = inp()
	mod = 1000000007
	limit = 10 ** 18
	ans = 0
	stack = []
	hashm = {}
	arr = []
	heapq.heapify(arr)
	for test in range(tests):
		n = inp()
		s = insr()
		ans = []
		for i in range(n):
			ans.append(s[i + i])
		print(''.join(ans))
main()


for i in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	itr = 0
	for j in range(n):
		string = s[j:j + n + 1]
		ans += string[itr]
		itr += 1
	print(ans)


t = int(input())
for tt in range(t):
	n = int(input())
	m = input()
	for i in range(0, n):
		print(m[2 * i], end='')
	print()


t = int(input())
for _ in range(t):
	S = []
	n = int(input())
	A = input()
	for j in range(n):
		res = 0
		for i in range(j, j + n):
			res = res | int(A[i])
		S.append(res)
	print(''.join((str(x) for x in S)))


for t in range(int(input())):
	n = int(input())
	s = input()
	w = s[n - 1] * n
	print(w)


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		s = input()
		a = ''
		for i in range(0, 2 * n - 1, 2):
			a += s[i]
		print(a)
	return
main()


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	m = [0 for i in range(n)]
	for i in range(n):
		for j in range(n):
			m[j] += s[i + j] == '1'
	ans = ''
	for i in range(n):
		if m[i] == 0:
			ans += '0'
		else:
			ans += '1'
	print(ans)


from collections import Counter
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	di = dict(Counter(s))
	if '1' not in di:
		print('0' * n)
	elif '0' not in di:
		print('1' * n)
	elif di['0'] > di['1']:
		print('0' * n)
	else:
		print('1' * n)


for ii in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	for i in range(0, 2 * n - 1, +2):
		ans += s[i]
	print(ans)


import sys
import itertools
for _ in range(int(input())):
	n = int(input())
	s = input()
	for i in range(n):
		print(s[i + i], end='')
	print()


n = int(input())
for i in range(n):
	n2 = int(input())
	sts = list(input())
	mid = len(sts) // 2
	c = sts[mid]
	print(c * n2)


t = int(input())
while t:
	n = int(input())
	s = input()
	w = ''
	for i in range(0, 2 * n - 1, 2):
		w = w + s[i]
	print(w)
	t = t - 1


import sys
INP = lambda : sys.stdin.readline().strip()
INT = lambda : int(INP())
MAP = lambda : map(int, INP().split())
ARR = lambda : [int(i) for i in INP().split()]

def JOIN(arr, x=' '):
	return x.join([str(i) for i in arr])

def EXIT(x='NO'):
	print(x)
	exit()
for _ in range(INT()):
	n = INT()
	s = INP()
	print(s[::2])


t = int(input())
for _ in range(t):
	n = int(input())
	a = input()
	s = ''
	c = 0
	for i in range(n):
		sub = a[i:i + n]
		s += sub[c]
		c += 1
	print(s)


t = int(input())
lst = []
for i in range(t):
	output = ''
	n = int(input())
	string = str(input())
	for j in range(2 * n):
		if j % 2 == 0:
			output += str(string[j])
	lst.append(output)
for i in lst:
	print(i)


for z in range(int(input())):
	n = int(input())
	s = input()
	print(s[::2])


import math
num_cases = int(input())
for _ in range(num_cases):
	n = int(input())
	s = input().strip()
	ans = [s[2 * (i - 1)] for i in range(1, n + 1)]
	print(''.join(ans))


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	k = ''
	for j in range(0, 2 * n, 2):
		k += s[j]
	print(k)


def ans(s, n):
	p = ''
	i = 1
	q = 2 * n - 1
	for i in range(0, q, 2):
		p += s[i]
	return p
for _ in range(int(input())):
	n = int(input())
	s = input()
	print(ans(s, n))


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	a = input()
	a = Counter(a)
	print(*(['1' * n], ['0'] * n)[a['0'] > a['1']], sep='')


def Ok(n, arr):
	count = 0
	res = ''
	for i in range(n):
		res += arr[i + count]
		count += 1
	return res
for _ in range(int(input())):
	n = int(input())
	arr = input()
	print(Ok(n, arr))


import sys
import os
import math
import copy
from math import gcd
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
import itertools

def Int():
	return int(sys.stdin.readline())

def Mint():
	return map(int, sys.stdin.readline().split())

def Lstr():
	return list(sys.stdin.readline().strip())

def Str():
	return sys.stdin.readline().strip()

def Mstr():
	return map(str, sys.stdin.readline().strip().split())

def List():
	return list(map(int, sys.stdin.readline().split()))

def Hash():
	return dict()

def Mod():
	return 1000000007

def Ncr(n, r, p):
	return fact[n] * (ifact[r] * ifact[n - r] % p) % p

def Most_frequent(list):
	return max(set(list), key=list.count)

def Mat2x2(n):
	return [List() for _ in range(n)]

def Lcm(x, y):
	return x * y // gcd(x, y)

def dtob(n):
	return bin(n).replace('0b', '')

def btod(n):
	return int(n, 2)

def common(l1, l2):
	return set(l1).intersection(l2)

def solution():
	for _ in range(Int()):
		n = Int()
		a = Lstr()
		ans = []
		for i in range(n):
			ans.append(a[i:i + n])
		s = ''
		for i in range(len(ans)):
			s += ans[i][i]
		print(s)
solution()


for t in range(int(input())):
	n = int(input())
	s = input()
	a = 0
	b = n
	new_s = ''
	for l in range(n):
		sub_s = s[a:b]
		new_s = new_s + sub_s[a]
		a += 1
		b += 1
	print(new_s)


for i in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	for i in range(n):
		ss = s[i:i + n]
		ans += ss[i]
	print(ans)


for test in range(int(input())):
	n = int(input())
	x = list(input())
	ans = ''
	for i in range(n):
		sum_temp = 0
		for j in range(i, i + n):
			sum_temp += int(x[j])
		if sum_temp == 0:
			ans = ans + '0'
		elif sum_temp == n:
			ans = ans + '1'
		else:
			ans = ans + '1'
	print(ans)


test = int(input())
for _ in range(test):
	n = int(input())
	s = input()
	arr = []
	for i in range(n):
		arr.append(s[i:i + n])
	ans = ''
	for i in range(len(arr)):
		ans += arr[i][i]
	print(ans)


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	l = []
	i = 0
	while i < n:
		j = i
		k = 0
		while True:
			l.append(s[j])
			j = j + 1
			k = k + 1
			if k == n:
				break
		i = i + 1
		l.append('\n')
	ll = []
	ss = ''
	for i in l:
		if i == '\n':
			ll.append(ss)
			ss = ''
		else:
			ss = ss + i
	k = ll[0]
	for i in ll:
		for j in range(n):
			if i[j] == k[j]:
				break
		else:
			for j in range(n):
				if i[j] != k[j]:
					k = k[:j] + i[j] + k[j + 1:]
					break
	print(k)
	t = t - 1


def solve():
	n = int(input())
	s = input()
	ans = ''
	for i in range(0, 2 * n, 2):
		ans += s[i]
	print(ans)
for _ in range(int(input())):
	solve()


for i in range(int(input())):
	d = int(input())
	f = input()
	g = ''
	for i in range(d):
		c = f[i:i + d]
		g = g + c[i]
	print(g)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	i = 0
	j = 2
	ans = ''
	while i < 2 * n - 1:
		ans += s[i]
		i += 2
	print(ans)


for _ in range(int(input())):
	N = int(input())
	s = input()
	a = s[N - 1] * N
	print(a)


t = int(input())
for i in range(0, t):
	n = int(input())
	s = str(input())
	for j in range(0, n):
		print(s[n - 1], end='')
	print()


def substring(string, n):
	output = []
	for i in range(0, 2 * n - 1, 2):
		output.append(string[i])
	print(''.join(output))
t = int(input())
for _ in range(t):
	n = int(input())
	string = input()
	substring(string, n)


t = int(input())
for i in range(t):
	n = int(input())
	s = str(input())
	if n == 1:
		print(s)
		continue
	co = 0
	cz = 0
	ans = ''
	for i in range(int(2 * n) - 1):
		if s[i] == '1':
			co += 1
		else:
			cz += 1
	if co > cz:
		ans = '1' * n
	else:
		ans = '0' * n
	print(ans)


import sys
import math

def solve(n, s):
	ans = ''
	for i in range(n):
		ans += s[i:n + i][i]
	return ans
for _ in range(int(input())):
	n = int(input())
	s = input()
	ans = solve(n, s)
	print(ans)


for _ in range(int(input())):
	n = int(input())
	a = input()
	b = ''
	i = 0
	while i < 2 * n - 1:
		b += a[i]
		i += 2
	print(b)


T = int(input())
for i in range(T):
	n = int(input())
	s = input()
	res = []
	A = [char for char in s]
	for i in range(0, len(A), 2):
		res.append(A[i])
	print(''.join(res))


a = int(input())
for i in range(a):
	n = int(input())
	s = input()
	t = s[n - 1]
	m = t * n
	print(m)


t = int(input())
answer = []
ans = []
counter = 0
for a in range(t):
	counter = 0
	n = int(input())
	ans = [0 for d in range(n)]
	line = list(input())
	for b in range(len(line) - n + 1):
		current = [line[c] for c in range(b, b + n)]
		check = int(ans[counter]) | int(current[counter])
		if str(check) == current[counter]:
			ans[counter] = current[counter]
			counter += 1
		else:
			while str(check) != current[counter]:
				counter += 1
				check = ans[counter] | int(current[counter])
	answer.append(''.join(map(str, ans)))
for i in answer:
	print(i)


from sys import stdin
for _ in range(int(stdin.readline())):
	stdin.readline()
	s = stdin.readline()
	print(s[::2])


import sys
cases = True

def c2(n):
	return n * (n + 1) // 2

def get():
	return list(map(int, input().split()))

def bits(n: int):
	return list(bin(n)).count('1')

def main(test_case=False):
	n = int(input()) if test_case else 1
	for _ in range(n):
		test()

def flush():
	sys.stdout.flush()

def parr(arr):
	print(*arr, sep=' ')

def gcd(a, b):
	while b:
		if b % a == 0:
			break
		tmp = a
		a = b % a
		b = tmp
	return a

def test():
	n = int(input())
	s = input()
	c = s[n - 1]
	t = c * n
	print(t)
main(cases)


for _ in range(int(input())):
	N = int(input())
	S = input()
	Ans = ''
	for i in range(0, 2 * N, 2):
		Ans += S[i]
	print(Ans)


import math as mt

def tran(s, n):
	an = ''
	for i in range(len(s)):
		if i % 2 == 0:
			an += s[i]
	return an
t = int(input())
ans = []
for i in range(t):
	n = int(input())
	s = input()
	r = tran(s, n)
	ans.append(r)
for i in ans:
	print(i)


from collections import Counter
for k in range(int(input())):
	n = int(input())
	s = input()
	a = Counter(s).most_common(1)
	print(a[0][0] * n)


n = int(input())
for i in range(n):
	m = int(input())
	s = input()
	for j in range(0, len(s), 2):
		print(s[j], end='')
	print()


t = int(input())
for i in range(0, t):
	n = int(input())
	s = input()
	l = []
	for j in range(0, 2 * n - 1, 2):
		l.append(s[j])
	print(''.join(l))


t = int(input())
while t:
	t = t - 1
	n = int(input())
	s = input()
	print(n * s[n - 1])


tc = int(input())
for t in range(tc):
	n = int(input())
	strr = input()
	for i in range(1, n + 1):
		print(strr[n - 1], end='')
	print('')


import sys

def input():
	return sys.stdin.readline().rstrip('\r\n')

def List():
	return list(map(int, input().split()))

def Num():
	return int(input())

def solve():
	n = Num()
	s = input()
	res = []
	for i in range(n):
		res.append(s[i:i + n])
	ans = ''
	for i in range(n):
		ans += res[i][i]
	print(ans)
for _ in range(Num()):
	solve()


a = int(input())
for i in range(a):
	n = int(input())
	s = str(input())
	t = ''
	for j in range(0, len(s), 2):
		t += s[j]
	print(t)


t = int(input())
Ans = []
for i in range(t):
	n = int(input())
	s = input()
	res = ''.join([s[i] for i in range(0, len(s), 2)])
	Ans.append(res)
for i in Ans:
	print(i)


for _ in range(int(input())):
	n = int(input())
	s = input()
	(i, j) = (0, n - 1)
	flag = True
	while j < 2 * n - 1:
		s1 = s[i:j + 1]
		if list(s1).count('1') == n:
			flag = False
			break
		i += 1
		j += 1
	if flag:
		print('0' * n)
	else:
		print('1' * n)


for it in range(1, int(input()) + 1):
	n = int(input())
	s = input()
	if s.count('0') > s.count('1'):
		print('0' * n)
	else:
		print('1' * n)


t = int(input())
for test_case in range(t):
	n = [int(x) for x in input().split()]
	n = n[0]
	res = 0
	s = [int(y) for y in input()]
	prom_num = ''
	for i in s:
		prom_num += str(i)
	s = str(prom_num)
	for i in range(2 ** n + 1):
		new = i
		b = ''
		if new == 0:
			b = '0'
		while new > 0:
			b = str(new % 2) + b
			new = new // 2
		if len(b) < n:
			prom_num = ''
			for k in range(n - len(b)):
				prom_num += '0'
			b = prom_num + b
		torf = True
		torfi = True
		s = str(s)
		for k in range(n):
			if torfi:
				torf = False
				for m in range(n):
					torf = torf or s[k + m] == b[m]
					if torf:
						break
				if torf == False:
					torfi = False
			else:
				break
		if torfi:
			res = b
			break
	print()
	print(res)
	print()


for i in range(int(input())):
	n = int(input())
	s = input()
	out = ''
	for j in range(n):
		t = s[j:j + n]
		out += t[j]
	print(out)


t = int(input())
for _ in range(t):
	n = int(input())
	a = input()
	s = ''
	for i in range(0, 2 * n - 1, 2):
		s += a[i]
	print(s)


t = int(input())
for _ in range(t):
	(n, s) = (int(input()), input())
	l = len(s)
	g = [s[i] for i in range(0, l, 2)]
	print(''.join(g))


for t in range(int(input())):
	n = int(input())
	s = input()
	ans = [s[0]]
	for i in range(1, n):
		ans.append(s[i + i])
	print(''.join(ans))


t = int(input())
for _ in range(t):
	n = int(input())
	s = list(input())
	print(s[0], end='')
	for i in range(1, 2 * n - 1):
		if i % 2 == 0:
			print(s[i], end='')
	print()


for _ in range(int(input())):
	n = int(input())
	s = input()
	print(''.join([s[n - 1]] * n))


(N,) = map(int, input().split())
for _ in range(N):
	(a,) = map(int, input().split())
	s = input().strip()
	print(s[:a][-1] * a)


t = int(input())
for i in range(t):
	n = int(input())
	s = [int(i) for i in list(input())]
	l = [s[i:i + n] for i in range(len(s) - n + 1)]
	l1 = l[:]
	i = 0
	ans = []
	while l:
		test = [a[i] for a in l]
		if test.count(1) > test.count(0):
			d = 1
		else:
			d = 0
		l = [f for f in l if f[i] != d]
		ans.insert(len(ans), str(d))
		i += 1
	if len(ans) == n:
		print(''.join(ans))
	else:
		le = len(ans)
		for i in range(n - le):
			ans.insert(le, '0')
		print(''.join(ans))


for __ in range(int(input())):
	n = int(input())
	s = list(map(int, input()))
	ans = ''
	for i in range(0, 2 * n, 2):
		ans += str(s[i])
	print(ans)


for q in range(int(input())):
	n = int(input())
	s = input()
	w = ''
	for i in range(n):
		w += s[i:i + n][i]
	print(w)


for i in range(int(input())):
	num = int(input())
	s1 = input()
	list_inp = [k for k in s1]
	x = [list_inp[num - 1]] * num
	print(''.join(x))


t = int(input())
for i in range(t):
	r = ''
	n = int(input())
	s = str(input())
	if n == 1 or n == 0:
		print(s[n - 1])
	else:
		for j in range(1, n + 1):
			for k in range(1, n + 1):
				r = r + s[n - 1]
				break
		print(r)


import sys
input = lambda : sys.stdin.readline().rstrip()
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	print(s[0:2 * n:2])


t = int(input())
for _ in range(t):
	n = int(input())
	s = list(input())
	ans = ''
	for i in range(n):
		ans += s[2 * i]
	print(ans)


def find():
	n = int(input())
	s = input()
	if len(s) == n:
		return s
	sub = ''
	ans = 0
	for i in range(0, len(s) - n + 1):
		sub = s[i:i + n]
		ans |= int(sub, 2)
	ans = bin(ans)[2:]
	if len(ans) < n:
		m = n - len(ans)
		ans = '0' * m + ans
	return ans
t = int(input())
while t > 0:
	print(find())
	t -= 1


for _ in range(int(input())):
	n = int(input())
	s = input()
	i = s.count('0')
	j = s.count('1')
	if j > i:
		print(n * '1')
	else:
		print(n * '0')


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
import threading
from collections import defaultdict
threading.stack_size(10 ** 8)
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
sys.setrecursionlimit(300000)
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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: max(a, b)):
		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):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] < key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
for ik in range(int(input())):
	n = int(input())
	s = input()
	c = 0
	we = 0
	for i in range(2 * n - 1):
		if s[i] == '0':
			c += 1
		else:
			we = max(we, c)
			c = 0
	we = max(we, c)
	if we >= n:
		ans = '0' * n
	else:
		ans = '1' * n
	print(ans)


for _ in range(int(input())):
	n = int(input())
	s = ''
	c = input()
	for i in range(0, 2 * n - 1, 2):
		s += c[i]
	print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ns = list(s[:n])
	c = 0
	for i in range(n):
		if ns[i] != s[c]:
			ns[i] = s[c]
		c += 2
	print(''.join(ns))


for _ in range(int(input())):
	x = int(input())
	s = input()
	print(s[x - 1] * x)


from sys import stdin, gettrace
if gettrace():
	inputi = input
else:

	def input():
		return next(stdin)[:-1]

	def inputi():
		return stdin.buffer.readline()

def solve():
	n = int(input())
	ss = input()
	ww = [s for s in ss[0::2]]
	print(''.join(ww))

def main():
	t = int(input())
	for _ in range(t):
		solve()
main()


import math
t = int(input())
for q in range(t):
	n = int(input())
	s = input()
	for i in range(n):
		print(s[n - 1], end='')
	print('')


import sys
sys.setrecursionlimit(500005)
stdin = sys.stdin
ns = lambda : stdin.readline().strip()
na = lambda : list(map(int, stdin.readline().split()))
ni = lambda : int(ns())
T = ni()
while T:
	n = ni()
	s = ns()
	ans = []
	for i in range(n):
		ans += s[i * 2]
	print(''.join(ans))
	T -= 1


query = int(input())
for x in range(query):
	i = int(input())
	b = list(map(int, input()))
	if len(b) != 1:
		print(str(b[i - 1]) * i)
	else:
		print(b[0])


import math
ls = lambda : list(map(int, input().split()))
ip = lambda : int(input())
sip = lambda : input()
r = lambda a: range(a)
lcm = lambda a, b: abs(a * b) // math.gcd(a, b)
t = ip()
for _ in r(t):
	n = ip()
	s = sip()
	d = {'0': 0, '1': 0}
	for i in s:
		d[i] += 1
	if d['1'] > d['0']:
		print('1' * n)
	else:
		print('0' * n)


t = int(input())
for i in range(t):
	n = int(input())
	a = input()
	b = ''
	c = len(a)
	for i in range(c):
		if i % 2 == 0:
			b = b + a[i]
	print(b)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	i = 0
	j = 0
	w = ''
	while i < n:
		w += s[i + j]
		j += 1
		i += 1
	print(w)


inp = lambda : [int(c) for c in input().split()]
for _ in range(int(input())):
	n = int(input())
	s = [int(c) for c in input()]
	arr = []
	for i in range(n):
		arr.append(s[i + i])
	print(''.join([str(c) for c in arr]))


t = int(input())
n_array = []
s_array = []
present_string = ''
present_character = 0
similar_string = ''
for i in range(t):
	n = int(input())
	n_array.append(n)
	s = str(input())
	if len(s) == 2 * n - 1:
		s_array.append(s)
	else:
		print('Wrong string entered')
for j in range(t):
	present_string = s_array[j]
	present_character = n_array[j] - 1
	similar_string = present_string[present_character]
	for r in range(n_array[j] - 1):
		similar_string = similar_string + present_string[present_character]
	print(similar_string)
	similar_string = ''


t = int(input())
for _ in range(t):
	n = int(input())
	ar = list(input())
	ans = list()
	for i in range(n):
		now = ar[i:i + n]
		ans.append(now[i])
	print(''.join(ans))


from sys import stdin

def solve(s, n):
	mask = list(s[:n])
	i = 1
	while n + i < 2 * n:
		subs = s[i:n + i]
		mask = [mask[k] if subs[k] == mask[k] else '0' for k in range(n)]
		i += 1
	return ''.join(mask)
t = int(stdin.readline().strip())
print_me = []
for _ in range(t):
	n = int(stdin.readline().strip())
	s = stdin.readline().strip()
	w = solve(s, n)
	print_me.append(w)
print('\n'.join(print_me))


from sys import stdin, stdout
t = int(stdin.readline())
for _ in range(t):
	w = int(stdin.readline())
	arr = stdin.readline()
	for i in range(len(arr)):
		if i % 2 == 0:
			print(arr[i], end='')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ans = ''
	Z = '0' * n
	O = '1' * n
	(zf, of) = (False, True)
	for i in range(len(s) - n + 1):
		tmp = s[i:i + n]
		if tmp == Z:
			zf = True
			of = False
		elif tmp == O:
			of = True
			zf = False
	if of:
		print(O)
	elif zf:
		print(Z)
	else:
		print('Not Exist')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	if n == 1:
		print(s)
	else:
		print(s[n - 1] * n)


T = int(input())
for t in range(T):
	n = int(input())
	s = input()
	g = s[n - 1]
	print(''.join(g * n))


t = int(input())
while t != 0:
	n = int(input())
	s = input()
	x = ''
	for i in range(n):
		x += '0'
		x = list(x)
	for i in range(len(s) - n + 1):
		a = s[i:i + n]
		pos = int(a.find('1'))
		if pos >= 0:
			x[pos] = '1'
	x = ''.join(x)
	print(x)
	t = t - 1


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	ans = ''
	if s[n - 1] == '1':
		dep = '1'
	else:
		dep = '0'
	for i in range(n):
		ans += str(dep)
	print(ans)
	t -= 1


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	s1 = ''
	for j in range(0, 2 * n - 1, 2):
		s1 = s1 + s[j]
	print(s1)


n = int(input())
for j in range(0, n):
	n1 = int(input())
	s = input()
	if s[n1 - 1] == '0':
		print('0' * n1)
	else:
		print('1' * n1)


for _ in range(int(input())):
	n = int(input())
	s = input()
	c = [0] * n
	for i in range(n):
		c[i] = s[i:n + i][i]
	print(''.join(c))


import math, queue, heapq
import sys
sys.setrecursionlimit(10 ** 6)
fastinput = sys.stdin.readline
fastout = sys.stdout.write
t = int(fastinput())
while t:
	t -= 1
	n = int(fastinput())
	s = input()
	no1 = s.count('1')
	if no1 >= n:
		print('1' * n)
	else:
		print('0' * n)


import sys, os.path
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
sys.setrecursionlimit(10 ** 5)

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def solve():
	n = II()
	str = input()
	print(str[::2])
for _ in range(II()):
	solve()


def bina(s1):
	n = (len(s1) + 1) // 2
	return s1[n - 1] * n
t = int(input())
for i in range(t):
	n = int(input())
	s1 = input()
	print(bina(s1))


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	print(s[n - 1] * n)


for t in range(int(input())):
	n = int(input())
	s = input()
	z = 0
	ln = len(s)
	for i in range(ln):
		if s[i] == '0':
			z = z + 1
	ans = ''
	if z >= n:
		for i in range(n):
			ans = ans + '0'
	else:
		for i in range(n):
			ans = ans + '1'
	print(ans)


for _ in range(int(input())):
	n = int(input())
	s = input()
	w = ''
	for i in range(n):
		t = s[i:i + n]
		w += t[i]
	print(w)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ans = ''
	for i in range(n):
		subs = s[i:n + i]
		ans += subs[i]
	print(ans)


def solve():
	n = int(input())
	s = input()
	print(s[n - 1] * n)

def main():
	for _ in range(int(input())):
		solve()
main()


for _ in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	temp = list(s[:n])
	for i in range(1, n + 1):
		ans = ans + temp[i - 1]
		if i + n - 1 < 2 * n - 1:
			temp.pop(0)
			temp.append(s[i + n - 1])
	print(ans)


t = int(input())
while t:
	n = int(input())
	s = input()
	l = []
	j = 1
	ans = ''
	for i in range(1, n + 1):
		l.append(s[i - 1:n])
		n += 1
	ans += l[0][0]
	for i in l[1:]:
		ans += i[j]
		j += 1
	print(ans)
	t -= 1


n = int(input())
for i in range(0, n):
	o = int(input())
	s = input().rstrip()
	x = list(s)
	Q = []
	T = 0
	for j in range(0, len(x) - o + 1):
		A = x[j:j + o]
		Q.append(A[T])
		T += 1
	print(''.join(Q))


def func(oz: str) -> str:
	if len(oz) == 1:
		return oz
	new = ''
	i = 0
	l = len(oz)
	l += 1
	l //= 2
	for i in range(0, l):
		d = oz[i:l + i]
		new += d[i]
	return new
T = int(input())
b = list(str())
for _ in range(T):
	n = int(input())
	inp = input()
	oup = func(inp)
	b.append(oup)
for i in b:
	print(i)


import math
t = int(input())
for w in range(t):
	n = int(input())
	s = input()
	print(s[n - 1] * n)


for _ in range(int(input())):
	n = int(input())
	li = input()
	li1 = li[n - 1]
	for i in range(1, 2 * n - 1, 2):
		li1 += li[i]
	print(li1)


T = int(input())
for _ in range(T):
	N = int(input())
	s = input()
	ans = ''
	shift = 0
	for i in range(N):
		ans += s[i + shift]
		shift += 1
	print(ans)


n = int(input())
for i in range(n):
	m = int(input())
	s = input()
	print(s[m - 1] * m)


from collections import Counter
res = ''
for _ in range(int(input())):
	n = int(input())
	a = dict(Counter([x for x in input()]))
	res += f'{max(a, key=a.get) * n}\n'
print(res)


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	(res, pos) = ('', n)
	for j in range(n):
		x = s[j:pos]
		res += x[j]
		pos += 1
	print(res)


def get_possible_strings(n, s):
	possibles = []
	for i in range(n):
		possibles.append(s[i:n + i])
	final_string = ''
	for i in range(n):
		c = 0
		for p in possibles:
			c |= int(p[i])
		final_string += str(c)
	return final_string
test_cases = int(input())
for i in range(test_cases):
	n = int(input())
	b_s = input()
	print(get_possible_strings(n, b_s))


for _ in range(int(input())):
	N = int(input())
	string = list(input())
	tobeprinted = []
	for i in range(0, 2 * N - 1, 2):
		tobeprinted.append(string[i])
	print(*tobeprinted, sep='')


t = int(input())
for _ in range(t):
	n = int(input())
	a = input()
	ans = ''
	k = 0
	now = 2 * n - 1
	for i in range(0, now, 2):
		ans += a[i]
	print(ans)


def findSimilar(s, n):
	substrs = []
	for i in range(n):
		substrs.append(s[i:i + n])
	ans = []
	for i in range(n):
		ans.append(substrs[i][i])
	return ''.join(ans)
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	print(findSimilar(s, n))


import sys
input = sys.stdin.readline
from bisect import bisect_left
from bisect import bisect_right
from math import ceil, factorial

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	n = int(input())
	s = input().strip()
	mset = set()
	for i in range(n):
		x = s[i:i + n]
		y = ''
		for j in x:
			if j == '1':
				y += '0'
			else:
				y += '1'
		y = int(y, 2)
		mset.add(y)
	ans = 0
	for i in range(n + 10):
		x = ans + i
		if x not in mset:
			ans = bin(x).replace('0b', '')
			ans = '0' * (n - len(ans)) + ans
			break
	print(ans)


for i in range(int(input())):
	n = int(input())
	s = input()
	if len(set(list(s))) == 1:
		print(s[0] * n)
		continue
	o = ''
	o += s[n - 1] * n
	print(o)


from collections import defaultdict as dd
import sys
input = sys.stdin.readline
t = int(input())
while t:
	n = int(input())
	s = input().split()[0]
	print(s[n - 1] * n)
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	w = []
	for i in range(n):
		w.append(s[i * 2])
	print(''.join(w))


t = int(input())
for __ in range(t):
	n = int(input())
	s = input()
	ans = s[0]
	for i in range(n):
		for j in range(len(ans)):
			if ans[j] == s[i + j]:
				break
			if j == len(ans) - 1:
				ans += s[i + j + 1]
	if len(ans) < n:
		ans += (n - len(ans)) * '0'
	print(ans)


import sys
I = lambda : int(input())
RL = readline = lambda : sys.stdin.readline().strip('\n')
RM = readmap = lambda x=int: map(x, readline().split(' '))
for _ in range(I()):
	(n, s) = (I(), RL())
	print(s[::2])


def funk(s, n):
	reply = []
	for i in range(2 * n - 1):
		if i % 2 == 0:
			reply.append(s[i])
	reply = ''.join(reply)
	print(reply)
t = int(input())
for i in range(t):
	n = int(input())
	s = str(input())
	funk(s, n)


for _ in range(int(input())):
	n = int(input())
	s = input()
	n -= 1
	if s[n] == '0':
		print('0' * (n + 1))
	else:
		print('1' * (n + 1))


import sys
from collections import defaultdict as dd
from collections import deque
from functools import *
from fractions import Fraction as f
from copy import *
from bisect import *
from heapq import *
from math import *
from itertools import permutations, product

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')

def inc(d, c):
	d[c] = d[c] + 1 if c in d else 1

def bo(i):
	return ord(i) - ord('A')

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def comp(a, b):
	if a > b:
		return 2
	return 2 if a == b else 0

def gi():
	return [xx for xx in input().split()]

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())

def gh():
	sys.stdout.flush()

def isvalid(i, j):
	return 0 <= i < n and 0 <= j < n

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = fi()
while t > 0:
	t -= 1
	n = fi()
	s = si()
	ans = ''
	for i in range(0, len(s), 2):
		ans += s[i]
	print(ans)


t = int(input())
for tt in range(t):
	n = int(input())
	nt = input()
	ans = ''
	for i in range(n):
		ans += nt[i:n + i][i]
	print(ans)


t = int(input().strip())
for i in range(t):
	n = int(input().strip())
	s = input().strip()
	w = []
	i = 0
	k = 0
	while i < n:
		w.append(s[i + k])
		i += 1
		k += 1
	print(''.join(w))


test = int(input())
for t in range(test):
	n = int(input())
	s = input()
	ans = ''
	for i in range(0, len(s), 2):
		ans += s[i]
	print(ans)


import io
import os
import sys
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def prdbg(*args, **kwargs):
	print(*args, **kwargs, file=sys.stderr)
	pass

def get_str():
	return input().decode().strip()

def rint():
	return map(int, input().split())

def oint():
	return int(input())
t = oint()
for _ in range(t):
	n = oint()
	s = get_str()
	ans = s[n - 1] * n
	print(''.join(ans))


for _ in range(int(input())):
	n = int(input())
	str1 = input()
	if n == 1:
		print(str1)
		continue
	for i in range(len(str1)):
		if i % 2 == 0:
			print(str1[i], end='')
	print('')


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		s = input()
		intS = int(s, 2)
		w = []
		for i in range(n):
			w.append(s[i:i + n][i])
		w = ''.join(w)
		print(w)
main()


for i in range(int(input())):
	t = int(input())
	l = input()
	l = list(l)
	if l[t - 1] == '1':
		print('1' * t)
	else:
		print('0' * t)


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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def print_list(l):
	print(' '.join(map(str, l)))
for _ in range(N()):
	n = N()
	s = input()
	M = (1 << n) - 1
	t = set()
	for i in range(n):
		k = int(s[i:i + n], base=2)
		t.add(M - k)
	for i in range(M + 1):
		if i not in t:
			res = str(bin(i))[2:]
			print('0' * (n - len(res)) + res)
			break


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	s = input().rstrip()
	ans = ''
	for j in range(len(s)):
		if j % 2 == 0:
			ans += s[j]
	print(ans)


import os
import sys
from io import BytesIO, IOBase

def main():
	pass
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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()

def test():
	n = int(input())
	a = input()
	return ''.join(a[::2])
t = int(input())
for _ in range(t):
	print(test())


t = int(input())
A = []
B = []
C = []
for i in range(t):
	n = int(input())
	s = input()
	B = ['1' for j in range(n)]
	C = ['0' for j in range(n)]
	one = ''.join(B)
	zero = ''.join(C)
	if s.find(one) != -1:
		A.append(one)
	elif s.find(zero) != -1:
		A.append(zero)
	else:
		A.append(one)
for i in A:
	print(i)


for i in range(int(input())):
	ans = ''
	n = int(input())
	lst = input()
	for i in range(n):
		ans += lst[2 * i]
	print(ans)


for _ in range(int(input())):
	n = int(input())
	s = input()
	w = ''
	if s.count('0') > s.count('1'):
		w = '0' * n
	elif s.count('0') < s.count('1'):
		w = '1' * n
	else:
		w = '0' * n
	print(w)


from sys import stdin

def solve(n, arr):
	out = ''
	for i in range(0, 2 * n - 1, 2):
		out += arr[i]
	print(out)
for _ in range(int(input())):
	n = int(input())
	arr = list(input())
	solve(n, arr)


i = int(input())
for j in range(i):
	k = int(input())
	binary = input()
	binary_aux = ''
	for n in range(k):
		binary_aux += str(binary[2 * n])
	print(binary_aux)


def check(arr):
	temp = [arr[x] for x in range(0, len(arr), 2)]
	return ''.join(temp)
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	result = check(s)
	print(result)


t = int(input())
for T in range(t):
	n = int(input())
	li = []
	st = list(input())
	if n == 1:
		print(st[0])
	elif n == 2:
		print(st[1] * 2)
	else:
		for i in range(2 * n - 1):
			if i % 2 == 0:
				li.extend(st[i])
		for j in range(n):
			print(li[j], end='')
		print()


for _ in range(int(input())):
	n = int(input())
	bin_string = str(input())
	value = []
	for i in range(n):
		value.append(bin_string[i:i + n])
	store = 0
	for substring_value in value:
		if '1' in substring_value:
			store += 1
	if store == len(value):
		print('1' * n)
	else:
		print('0' * n)


for t in range(int(input())):
	(n, inp) = [input(), input()]
	print(inp[0::2])


def tran(s, n):
	a = ''
	for i in range(n):
		c = s[2 * i]
		a += c
	return a
t = int(input())
ans = []
for i in range(t):
	n = int(input())
	s = input()
	r = tran(s, n)
	ans.append(r)
for i in ans:
	print(i)


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	s = stdin.readline().rstrip()
	print(s[::2])


try:
	t = int(input())
	while t != 0:
		n = int(input())
		string = input()
		string = list(string)
		i = 0
		popi = []
		while i < n:
			popi.append(string[i:n + i])
			i = i + 1
		result = ''
		for i in range(n):
			result += popi[i][i]
		print(result)
except EOFError:
	print(' ')


for _ in range(int(input())):
	_ = input()
	s = list(input())
	print(''.join(s[::2]))


test = int(input())
for _ in range(test):
	n = int(input())
	arr = list(input())
	res = ['0'] * n
	for i in range(n):
		for j in range(i, i + n):
			if arr[j] == '1':
				res[j - i] = '1'
	print(''.join(res))


for _ in range(int(input())):
	n = int(input())
	data = list(map(int, list(input())))
	out = []
	for i in range(0, 2 * n - 1, 2):
		out.append(data[i])
	print(*out, sep='')


t = int(input())
for i in range(t):
	n = int(input())
	binary = input()
	res = 0
	if n > len(binary):
		res = binary[n - 1] * (n - len(binary))
	else:
		res = binary[n - 1] * n
	print(res)


for k in range(int(input())):
	p = int(input())
	str = input()
	(i, j) = (0, p - 1)
	r = 1
	while j < 2 * p - 1:
		s1 = str[i:j + 1]
		if list(s1).count('1') == p:
			r = 0
			break
		i += 1
		j += 1
	if r:
		print('0' * p)
	else:
		print('1' * p)


n = int(input())
for _ in range(n):
	n1 = int(input())
	n2 = input()
	kk = []
	if n1 == 1 and n2 == '1':
		print('1')
	elif n1 == 1 and n2 == '0':
		print('0')
	elif n1 == len(n2):
		print(n2)
	else:
		for i in range(len(n2) - n1 + 1):
			if n2[i:i + n1].count('1') >= 1:
				kk.append('1')
			else:
				kk.append('0')
		ss = ''
		for i in kk:
			ss = ss + i
		print(ss)


for i in range(int(input())):
	a = int(input())
	s = input()
	b = ''
	for i in range(0, 2 * a - 1, 2):
		b += s[i]
	print(b)


for i in range(int(input())):
	n = int(input())
	string1 = str(input())
	a = 2 * n - 1
	i = 0
	output = ''
	while i < a:
		output += string1[i]
		i += 2
	print(output)


import math
for _ in range(int(input())):
	n = int(input())
	s = input()
	z = s.count('0')
	on = s.count('1')
	if z == 0:
		print('1' * n)
	elif on == 0:
		print('0' * n)
	elif z > on:
		print('0' * n)
	else:
		print('1' * n)


import sys
import math
import collections
import bisect
import itertools
import decimal
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
MOD = 10 ** 9 + 7
ni = lambda : int(sys.stdin.readline().rstrip())
ns = lambda : map(int, sys.stdin.readline().rstrip().split())
na = lambda : list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda : list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))

def main():
	t = ni()
	for _ in range(t):
		t_ni = ni()
		s = input()
		tmp = s[t_ni - 1]
		ans = [tmp] * t_ni
		print(*ans, sep='')
main()


for t in range(int(input())):
	n = int(input())
	s = input()
	ans = ['0'] * n if s[n - 1] == '0' else ['1'] * n
	print(''.join(ans))


for _ in range(int(input())):
	n = int(input())
	s = input()
	w = []
	i = 0
	while i < len(s):
		w.append(s[i])
		i += 2
	print(''.join(w))


import io
import os
from collections import Counter, defaultdict, deque

def solve(N, S):
	ans = []
	for i in range(N):
		ans.append(S[2 * i])
	return ''.join(ans)
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
TC = int(input())
for tc in range(1, TC + 1):
	(N,) = [int(x) for x in input().split()]
	S = input().decode().rstrip()
	ans = solve(N, S)
	print(ans)


def main():
	n = int(input())
	l = input()
	new_l = ''
	for i in range(0, n * 2 - 1, 2):
		new_l += l[i]
	print(new_l)
t = int(input())
for i in range(t):
	main()


test = int(input())
for i in range(0, test):
	n = int(input())
	s = str(input())
	ans = ''
	listofs = list()
	i1 = 0
	count1 = 0
	count0 = 0
	limit = 2 * n - 1
	while i1 < n:
		listofs.append(s[i1:n + 1 + i1])
		i1 = i1 + 1
	for k in range(0, n):
		ans = ans + listofs[k][k]
	print(ans)


from sys import stdin, stdout
test = int(stdin.readline())
for _ in range(test):
	n = int(stdin.readline())
	s = stdin.readline().strip()
	ans = s[n - 1] * n
	print(''.join(ans))


t = int(input())
n = []
s = []
for _ in range(t):
	n.append(int(input()))
	s.append(input())
for i in range(t):
	line = s[i]
	x = line[n[i] - 1]
	print(x * n[i])


Test = int(input())
for i in range(Test):
	n = int(input())
	binary = input()
	binary_list = []
	new = ''
	for j in range(0, n):
		new = binary[j:j + n]
		binary_list.append(new)
	str = ''
	for k in range(len(binary_list)):
		str += binary_list[k][k]
	print(str)


for _ in range(int(input())):
	n = int(input())
	s = input()
	s1 = ''
	for i in range(0, 2 * n, 2):
		s1 += s[i]
	print(s1)


for cases in range(int(input())):
	n = int(input())
	string = input()
	for i in range(0, 2 * n - 1, 2):
		print(string[i], end='')
	print()


from collections import defaultdict as dc
import sys
from collections import Counter as cnt
from collections import deque as dq
from copy import copy, deepcopy
import itertools
import math
mod = 10 ** 9 + 7

def sinp():
	p = str(sys.stdin.readline())
	return p

def seive(n):
	p = [0] * (n + 1)
	for i in range(2, n):
		for j in range(2 * i, n + 1, i):
			p[i] = 1
	return p

def inp():
	p = int(sys.stdin.readline())
	return p

def line():
	p = list(map(int, sys.stdin.readline().split()))
	return p

def read_mat():
	n = inp()
	a = []
	for i in range(n):
		a.append(line())
	return a

def ind(a):
	return ord(a) - ord('A')

def digit(n):
	p = [int(i) for i in str(n)]
	return p

def check(p, n):
	l = str(p)
	s = ''
	for i in range(n):
		s = s + bin(int(l[i]))[2:]
	s = s[:-n]
	if s == '':
		return 0
	return int(s, 2)

def createcomb(a, n, i):
	if i == n:
		ans.append(a)
	else:
		for z in range(n):
			a.append(a[z])
			createcomb(a, n, z)
			a.pop()

def solve(a, n, a1, b1, c1):
	l = []
	r = []
	x = 0
	for i in range(n):
		if a[i] >= x:
			l.append(i)
			x = a[i]
	x = 0
	for i in range(n - 1, -1, -1):
		if a[i] >= x:
			r.append(i)
			x = a[i]
	z = cnt(r)
	c = 0
	p = len(l)
	q = len(r)
	for i in l:
		if z[i]:
			c += 1
	if p == a1 and q == b1 and (c1 == c):
		return 1
	return 0

def xor(a, b):
	s = ''
	for i in range(len(a)):
		if a[i] == '1' and b[i] == '0':
			s += '1'
		elif b[i] == '1' and a[i] == '0':
			s += '1'
		else:
			s += '0'
	return s
for t in range(inp()):
	n = inp()
	a = str(input())
	s = ''
	for i in range(len(a) - n + 1):
		s += a[i:i + n][i]
	print(s)


import sys
import bisect
t = int(input())
mod = 10 ** 9 + 7
for _ in range(t):
	n = int(input())
	s = input()
	j = 0
	for i in range(n):
		print(s[j], end='')
		j += 2
	print()


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		b = input()
		print(b[::2])
main()


for _ in range(int(input())):
	n = int(input())
	s = str(input())
	res = ''
	for i in range(n):
		temp = s[i:n + i]
		res += temp[i]
	print(res)


import sys, math
input = lambda : sys.stdin.readline().rstrip()
for __ in range(int(input())):
	n = int(input())
	s = input()
	(zer, f) = (0, 0)
	for i in s:
		if i == '0':
			zer += 1
		else:
			f += 1
	if f > zer:
		print(n * '1')
	elif zer > f:
		print(n * '0')
	else:
		print(s[0] * n)


t = int(input())

def proverka(a, b, c):
	for i in range(len(a)):
		if i not in c:
			b[i] = a[i]
			c.append(i)
			return b
for i in range(t):
	c = []
	n = int(input())
	otvet = ['0'] * n
	s = str(input())
	k = list(s)
	for j in range(0, n):
		stroka = [s[l] for l in range(j, j + n)]
		otvet = proverka(stroka, otvet, c)
	print(''.join(otvet))


for _ in range(int(input())):
	n = int(input())
	data = input()
	ans = data[n - 1]
	ans = ans * n
	print(ans)


t = int(input())
for _ in range(t):
	(n, s) = (int(input()), input())
	if len(set(s)) == 1:
		print(s[0] * n)
	else:
		g = [s[i] for i in range(0, len(s), 2)]
		print(*g, sep='')


test_cases = int(input())
for i in range(test_cases):
	length = int(input())
	numbers = str(input())
	rtn = ''
	for i in range(0, len(numbers), 2):
		rtn += str(numbers[i])
	print(rtn + '\n')


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	char = s[n - 1]
	print(n * char)


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	if s.count('0') > s.count('1'):
		for j in range(n):
			print('0', end='')
		print('\n')
	else:
		for j in range(n):
			print('1', end='')
		print('\n')


from collections import deque
from collections import OrderedDict
import math
import sys
import os
import threading
import bisect
import operator
import heapq
from atexit import register
from io import BytesIO
import io
from sys import stdin, stdout
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')
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	n = int(input())
	s = input()
	maxCount0 = 0
	maxCount1 = 1
	(lCoun0, lCoun1) = (0, 0)
	for i in range(2 * n - 1):
		if s[i] == '0':
			lCoun0 += 1
			lCoun1 = 0
			maxCount0 = max(maxCount0, lCoun0)
		else:
			lCoun1 += 1
			lCoun0 = 0
			maxCount1 = max(maxCount1, lCoun1)
	if maxCount0 >= maxCount1:
		for i in range(n):
			print(0, sep='', end='')
	else:
		for i in range(n):
			print(1, sep='', end='')
	print()
sys.exit(0)

class Person:

	def __init__(self, name, age):
		self.name = name
		self.age = age
p1 = Person('heelo', 27)
print(help(Person))
age = 26
name = 'Swaroop'
print('Возрас {} -- {} лет'.format(name, age))
print(help(object))


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	i = 0
	ans = ''
	while i < 2 * n - 1:
		ans = ans + s[i]
		i += 2
	print(ans)
	t -= 1


import math
import os
import random
import re
import string
from sys import *
from collections import *

def bs(arr, x, l, r):
	if l <= r:
		mid = (r + l) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] > x:
			return bs(arr, x, l, mid - 1)
		else:
			return bs(arr, x, mid + 1, r)
	else:
		return -1

def solve():
	for _ in range(int(input())):
		n = int(input())
		s = input()
		if n == 1:
			print(s)
		else:
			print(s[n - 1] * n)
solve()


for _ in range(int(input())):
	a = int(input())
	b = input()
	c0 = b.count('0')
	c1 = b.count('1')
	if c0 > c1:
		print('0' * a)
	else:
		print('1' * a)


cases = int(input())
for i in range(cases):
	n = int(input())
	s = input()
	ans = ''
	start = 0
	for j in range(n):
		temp = s[j:j + n]
		ans += temp[start]
		start += 1
	print(ans)


def main():
	for _ in range(int(input())):
		n = int(input().strip())
		binary = input().strip()
		output = ''
		for idx in range(0, len(binary), 2):
			output += binary[idx]
		print(output[:n])
main()


t = int(input())
for case in range(t):
	n = int(input())
	s = input()
	print(s[::2])


import sys, collections, math

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def input():
	return sys.stdin.readline().strip()
mod = 1000000007
for _ in range(int(input())):
	n = int(input())
	s = input()
	arr = ''
	for i in range(0, len(s), 2):
		arr += s[i]
	print(arr)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ans = s[n - 1] * n
	print(ans)


try:
	t = int(input())
	for _ in range(t):
		n = int(input())
		s = input()
		output = ''
		x = 0
		z = 0
		while x < n:
			output += s[x + z]
			x += 1
			z = x
		print(output)
except:
	pass


from functools import lru_cache
from sys import stdin, stdout
import sys
from math import *
sys.setrecursionlimit(int(200000.0 + 10))
for __ in range(int(input())):
	n = int(input())
	s = input()
	if n == 1:
		print(s)
	else:
		ans = ''
		for i in range(n):
			if s[i:i + n] == '1' * n or s[i:i + n] == '0' * n:
				ans += s[i]
			else:
				ans += '0'
		print(ans)


T = int(input())
for t in range(T):
	n = int(input())
	a = input()
	ns = a[n - 1] * n
	print(ns)


t = int(input())
for q in range(t):
	n = int(input())
	s = input()
	num_0 = s.count('0')
	num_1 = s.count('1')
	if max(num_0, num_1) == num_0:
		for i in range(n):
			print('0', end='')
		print()
	elif max(num_0, num_1) == num_1:
		for i in range(n):
			print('1', end='')
		print()


import sys

def solve(S, n):
	C = S[n - 1] * n
	return ''.join(C)
IN = [x.strip() for x in sys.stdin.readlines()]
T = int(IN[0])
cur = 0
for ti in range(T):
	n = int(IN[cur + 1])
	S = IN[cur + 2]
	res = solve(S, n)
	print(res)
	cur += 2


for test in range(int(input())):
	n = int(input())
	s = input().strip()
	print(s[n - 1] * n)


def main():
	t = int(input())
	for __ in range(t):
		n = int(input())
		s = input()
		ans = []
		i = 0
		j = 0
		while j < n:
			ans.append(s[i])
			i += 2
			j += 1
		print(''.join(ans))
main()


for i in range(int(input())):
	n = int(input())
	str = input()
	s = [0] * n
	(i, j) = (0, 0)
	while i < n and j < 2 * n - 1:
		s[i] = str[j]
		i = i + 1
		j = j + 2
	print(''.join((k for k in s)))


from sys import stdin, stdout
from collections import defaultdict
import math
input = stdin.readline

def print(x):
	stdout.write(str(x) + '\n')
for _ in range(int(input())):
	n = int(input())
	s = input().strip()
	ans = ''
	for i in range(n):
		ans += s[i + i]
	print(ans)


test_cases = int(input())
for case in range(test_cases):
	(left, right, s, b) = (0, 0, '', [])
	n = int(input())
	right = n
	binary = input()
	if n > 1:
		for var in range(n):
			b = [l for l in binary[var:n + var]]
			s += b[var]
			b = [d for d in binary[var:n + var]]
	else:
		s = binary[0]
	print(s)


for _ in range(int(input())):
	n = int(input())
	s = input()
	if len(set(s[:n])) == 1:
		print(list(set(s[:n]))[0] * n)
	else:
		print(list(set(s[n - 1:]))[0] * n)


import math
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	s = input()
	char = s[n - 1]
	print(n * char)


t = int(input())
output = []
for i in range(t):
	n = int(input())
	s = input()
	substrings = []
	for j in range(1, n + 1):
		substrings.append(s[j - 1:j + n - 1])
	w = ''
	for j in range(len(substrings)):
		x = substrings[j]
		w = w + x[j]
	output.append(w)
for ans in output:
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	l = 2 * n - 1
	final = ''
	i = 0
	while i < l:
		final = final + s[i]
		i += 2
	print(final)


t = lambda : range(int(input()))
for _ in t():
	n = int(input())
	s = input()
	if n == 1:
		print(s)
	else:
		print(s[n - 1] * n)


a = int(input())
while a > 0:
	a -= 1
	b = int(input())
	c = input()
	d = ''
	for i in range(0, b):
		e = c[i:b + i]
		d += e[i]
	print(d)


t = int(input())
for i in range(t):
	n = int(input())
	s = input().strip()
	ans = ''
	for i in range(0, 2 * n - 1, 2):
		ans += s[i]
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	ar = [int(i) for i in input()]
	nar = []
	for x in range(len(ar)):
		if x % 2 == 0:
			nar.append(ar[x])
		else:
			pass
	print(''.join((str(i) for i in nar)))


def main():
	t = int(input())
	while t:
		n = int(input())
		inp = str(input())
		print(inp[::2])
		t -= 1
main()


for _ in range(int(input())):
	n = int(input())
	s = input()
	f = []
	t = ''
	for i in range(len(s) - n + 1):
		f.append(s[i:i + n])
	for i in range(len(f)):
		for j in range(len(f[0])):
			if i == j:
				t += f[i][j]
	print(t)


def findNum(s, n):
	ans = ''
	for i in range(n):
		ans += s[i + i]
	return ans
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	result = findNum(s, n)
	print(result)


def XOR(s):
	pass
for _ in range(int(input())):
	n = int(input())
	s = input()
	x = s[:n]
	ans = x[0]
	k = 1
	for i in range(n + 1, len(s) + 1):
		x = s[k:i]
		ans += x[k]
		k += 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	a = str(input())
	c = []
	ans = ''
	for i in range(len(a) - (n - 1)):
		c.append(a[i:i + n])
	ii = 0
	for k in c:
		ans = ans + k[ii]
		ii = ii + 1
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	c = ''
	for i in range(n):
		c = c + s[2 * i]
	print(c)


for i in range(int(input())):
	n = int(input())
	s = input()
	s1 = ''
	for i in range(len(s)):
		if i % 2 == 0:
			s1 = s1 + s[i]
	print(s1)


from itertools import product
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().rstrip()))
	for bit in product([0, 1], repeat=n):
		tmp1 = []
		for i in range(len(arr) - n + 1):
			tmp2 = []
			for (x, y) in zip(bit, arr[i:i + n]):
				if x == y:
					tmp2.append(True)
				else:
					tmp2.append(False)
			if any(tmp2):
				tmp1.append(True)
			else:
				tmp1.append(False)
		if all(tmp1):
			print(*list(bit), sep='')
			break


t = int(input())
for i in range(t):
	l = int(input())
	string = input()
	count = 0
	s = ''
	c = 0
	ans = ''
	for j in range(l):
		s = s + '0'
	list_str = list(s)
	for j in range(l):
		temp_str = string[count:count + l]
		list_temp_str = list(temp_str)
		if list_str[c] != list_temp_str[c]:
			list_str[c] = list_temp_str[c]
		c = c + 1
		count = count + 1
	for j in range(l):
		ans = ans + str(list_str[j])
	print(ans)


for i in range(int(input())):
	n = int(input())
	s = input()
	bits = ''
	for i in range(n):
		bits += s[i * 2]
	print(bits)


def similar_string(s):
	return s[::2]
for _ in range(int(input())):
	n = int(input())
	s = input()
	print(similar_string(s))


for _ in range(int(input())):
	n = int(input())
	s = list(input())
	a = [y for (x, y) in enumerate(s) if x % 2 == 0]
	print(*a, sep='')


import sys

def input():
	return sys.stdin.readline().rstrip()

def input_split():
	return [int(i) for i in input().split()]
testCases = int(input())
answers = []
for _ in range(testCases):
	n = int(input())
	s = input()
	ans = s[n - 1] * n
	answers.append(ans)
print(*answers, sep='\n')


testcases = int(input())
for i in range(testcases):
	n = int(input())
	l = input()
	l = l[::2]
	print(l)


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	s = str(input())
	k = 0
	z = n
	psub = []
	while z <= 2 * n - 1:
		psub += [s[k:z]]
		z += 1
		k += 1
	ans = ''
	l = 0
	for i in psub:
		ans += str(i[l])
		l += 1
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	bruh = input()
	x = bruh[n - 1]
	if x == '1':
		print('1' * n)
	else:
		print('0' * n)


for _ in range(int(input())):
	n = int(input())
	st = [int(x) for x in input()]
	c0 = 0
	c1 = 0
	for i in st:
		if i == 0:
			c0 += 1
		else:
			c1 += 1
	if c0 > c1:
		print('0' * n)
	else:
		print('1' * n)


from itertools import count
import sys
from array import array
import typing as Tp

def input():
	return sys.stdin.buffer.readline().decode('utf-8')

def output(*args):
	sys.stdout.buffer.write(('\n'.join(map(str, args)) + '\n').encode('utf-8'))

def main():
	t = int(input())
	ans_a = [''] * t
	for ti in range(t):
		n = int(input())
		s = input().rstrip()
		ans_a[ti] = s[n - 1] * n
	output(*ans_a)
main()


def solve():
	n = int(input())
	s = input()
	ans = ''
	for i in range(0, len(s), 2):
		ans += s[i]
	print(ans)
t = int(input())
while t > 0:
	solve()
	t -= 1


x = int(input())
test_n = []
comp = []
for i in range(x):
	t = int(input())
	p = input()
	test_n.append(t)
	comp.append(p)

def similar(p, x):
	t = 0
	for i in range(len(p)):
		if p[i] == x[i]:
			t = 1
			break
	if t == 0:
		return False
	return True
for i in range(x):
	p = 2 ** test_n[i]
	l = comp[i]
	t = [l[j:j + test_n[i]] for j in range(len(l) - test_n[i] + 1)]
	for g in range(p):
		c = str(bin(g).replace('0b', '')).zfill(test_n[i])
		yes = 0
		for q in t:
			if similar(c, q):
				yes = 1
			else:
				yes = 0
				break
		if yes == 1:
			print(c)
			break


from sys import stdin, stdout
q = int(input())
for i in range(q):
	n = int(input())
	s = input()
	a = ''
	for i in range(0, 2 * n - 1, 2):
		a += s[i]
	print(a)


for i1 in range(int(input())):
	n = int(input())
	s = input()
	s = s.replace('\r', '')
	ans = s[n - 1]
	print(ans * n)


T = int(input())
for i in range(T):
	n = int(input())
	s = input()
	ans = s[n - 1] * n
	print(ans)


def string_similarity(n: int, s: str) -> str:
	return s[:len(s):2]
t = int(input())
for _ in range(t):
	print(string_similarity(int(input()), input()))


for _ in range(int(input())):
	n = int(input())
	st = str(input())
	ans = []
	for i in range(0, len(st), 2):
		ans.append(st[i])
	print(''.join(ans))


for _ in range(int(input())):
	n = int(input())
	st = input()
	print(st[(2 * n - 1) // 2] * n)


t = int(input())
for _ in range(t):
	n = input()
	l = input()
	print(l[::2])


n = int(input())
for i in range(n):
	t = int(input())
	st = input()
	list1 = []
	for j in range(0, len(st) - t + 1):
		list1.append(st[j:j + t])
	ans = ''
	j = 0
	for i in range(t):
		ans += list1[i][j]
		j += 1
	print(ans)


def ispoh(a, b):
	for i in range(len(a)):
		if a[i] == b[i]:
			return True
	return False
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ans = s[0:n]
	first = 0
	for i in range(1, len(s) + 1 - n):
		otr = s[i:i + n]
		if ispoh(ans, otr) == False:
			ans = ans[:first] + otr[first] + ans[first + 1:]
			first += 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	s = input()
	x = 0
	for i in range(n):
		print(s[i + x], end='')
		x += 1
	print()


for nt in range(int(input())):
	n = int(input())
	s = input()
	print(s[n - 1] * n)


def similar(s1, s2):
	for i in range(len(s1)):
		if s1[i] == s2[i]:
			return True
	return False

def xor(a, b):
	for i in range(len(a)):
		if a[i] == b[i]:
			ans += '0'
		else:
			ans += '1'
	return ans
n = int(input())

def generate(n):
	A = []
	import random
	for x in range(n):
		A.append(str(random.randint(0, 1)))
	return ''.join(A)
for x in range(n):
	nn = int(input())
	s = input()
	count = 0
	strings = []
	for y in range(nn):
		strings.append(s[y:y + nn])
	while True:
		testS = generate(nn)
		for abc in strings:
			if similar(abc, testS) == False:
				break
		else:
			print(testS)
			break


for _ in range(int(input())):
	n = int(input())
	s = input()
	print(s[0::2])


import collections
import math

def sort(key):
	return key[1]

def pack(key):
	return key[0]

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

def solve(l, p):
	if l <= 1:
		return p
	ones = 0
	zeros = 0
	mxOnes = 0
	mxZeros = 0
	for i in range(len(p)):
		if zeros > mxZeros:
			mxZeros = zeros
		if ones > mxOnes:
			mxOnes = ones
		if p[i] == '1':
			zeros = 0
			ones += 1
		else:
			ones = 0
			zeros += 1
	if zeros > mxZeros:
		mxZeros = zeros
	if ones > mxOnes:
		mxOnes = ones
	if mxZeros > mxOnes:
		return '0' * l
	else:
		return '1' * l
k = int(input())
for i in range(k):
	l = int(input())
	p = input()
	print(solve(l, p))


t = int(input())
for i in range(t):
	n = int(input())
	st = input()
	for i in range(n):
		print(st[n - 1], end='')
	print()


for _ in range(int(input())):
	n = int(input())
	arr = input()
	[print(arr[j], end='') for j in range(2 * n - 1) if j % 2 == 0]
	print()


def func():
	i = int(input())
	st = input()
	x = st.count('1')
	y = st.count('0')
	if x > y:
		return '1' * i
	else:
		return '0' * i
final = []
for i in range(int(input())):
	final.append(func())
print(*final, sep='\n')


for _ in range(int(input())):
	n = int(input())
	string = input()
	ch = string[n - 1]
	print(ch * n)


from sys import stdin, stdout
from collections import Counter
from itertools import permutations
import bisect
import math
I = lambda : map(int, stdin.readline().split())
I1 = lambda : stdin.readline()
for _ in range(int(I1())):
	n = int(I1())
	s = I1().strip()
	s1 = ''
	i = 0
	while i < 2 * n - 1:
		s1 += s[i]
		i += 2
	print(s1)


for _ in range(int(input())):
	(_, s) = (int(input()), input())
	l = s[::2]
	print(''.join(l))


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	q = s[int(len(s) / 2)]
	print(q * n)
	t -= 1


for _ in range(int(input())):
	n = int(input())
	a = input()
	l = [0] * 2
	for i in a:
		if i == '0':
			l[0] += 1
		if i == '1':
			l[1] += 1
	print(*(['1' * n], ['0' * n])[l[0] > l[1]], sep='')


tc = int(input())
for i in range(tc):
	n = int(input())
	s = input()
	out = s[n - 1]
	output = out * n
	print(output)


t = int(input())
for _ in range(t):
	n = int(input())
	a = input()
	c = a[n - 1]
	ans = c * n
	print(ans)


for ii in range(int(input())):
	n = int(input())
	a = input()
	ans = ''
	for jj in range(0, 2 * n, 2):
		ans += a[jj]
	print(ans)


testcases = int(input())
for testcase in range(testcases):
	n = int(input())
	strs = input()
	nn = len(strs)
	if nn == n:
		print(strs)
		continue
	ans = strs[:n]
	ans = int(ans, 2)
	commondigit = [1 for _ in range(n)]
	for i in range(0, nn - n + 1):
		newstrs = strs[i:i + n]
		for j in range(n):
			commondigit[j] &= int(newstrs[j])
	strs = ''
	for i in commondigit:
		strs += str(i)
	print(strs)


cases = int(input())
for _ in range(cases):
	n = int(input())
	s = input()
	m = ''
	index = 0
	for i in range(len(s) - n + 1):
		t = s[i:i + n]
		m += t[index]
		index += 1
	print(m)


def main():
	tc = 1
	tc = int(input())
	for i in range(tc):
		solve()

def solve():
	n = int(input())
	s = input()
	print(s[::2])
main()


for _ in range(int(input())):
	n = int(input())
	string = input()
	ans = []
	for i in range(0, 2 * n - 1, 2):
		ans.append(string[i])
	print(''.join(ans))


def similar():
	n = int(input())
	s = input()
	answer = ''
	for i in range(n):
		buff = s[i:n + i]
		answer += buff[i]
	return answer
for t in range(int(input())):
	print(similar())


t = int(input())
for i in range(t):
	b = int(input())
	s = str(input())
	d = ''
	for i in range(0, len(s), 2):
		d += s[i]
	print(d)


import sys
input = sys.stdin.readline

def solution():
	n = int(input())
	A = list(map(int, input().rstrip()))
	arr = [A[i:i + n] for i in range(n)]
	ans = [0] * n
	for i in range(n):
		ans[i] = arr[i][i]
	print(''.join(map(str, ans)))
T = int(input())
for _ in range(T):
	solution()


n = int(input())
for i in range(n):
	t = int(input())
	s = input()
	if len(s) == 1:
		print(s)
	else:
		ans = []
		if len(s) % 2 != 0:
			for i in range(0, len(s), 2):
				ans.append(s[i])
		for i in ans:
			print(str(i), end='')
		print()


for t in range(int(input())):
	n = int(input())
	bin = list(input())
	for i in range(0, 2 * n, 2):
		print(bin[i], end='')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	d = input()
	print(d[::2])


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
sys.setrecursionlimit(100000000)
ii = lambda : int(input())
si = lambda : input()
jn = lambda x, l: x.join(map(str, l))
sl = lambda : list(map(str, input().strip()))
mi = lambda : map(int, input().split())
mif = lambda : map(float, input().split())
lii = lambda : list(map(int, input().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
mod = 1000000007
for _ in range(ii()):
	n = ii()
	s = si()
	a = s.count('0')
	b = s.count('1')
	sa = ''
	count = 0
	if n == 1:
		print(s)
	else:
		for i in range(n):
			sa += s[i:][count]
			count += 1
		print(sa)


import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	binary = input()
	split = []
	for i in range(len(binary) - n):
		split.append(binary[i:i + n])
	ans = '1'
	ans += '1' * (n - len(ans))
	for part in split:
		if part.count('1') == n:
			ans = '1' * n
			break
		elif part.count('0') == n:
			ans = '0' * n
			break
	print(ans)
T = int(input())
for _ in range(T):
	solve()


t = int(input())
for p in range(t):
	n = int(input())
	s = input()
	char = s[n - 1]
	print(char * n)


from sys import stdin, stdout

def find(S, N):
	k = S[N - 1]
	return ''.join([k] * N)

def main():
	for _ in range(int(stdin.readline())):
		N = int(stdin.readline())
		S = stdin.readline().strip()
		print(find(S, N))
main()


t = int(input())
for test in range(t):
	n = int(input())
	s = input()
	n1 = '1' * n
	ans = []
	for i in range(n):
		if s[i:i + n] == n1:
			ans.append('1')
		else:
			ans.append('0')
	print(*ans, sep='')


for u in range(int(input())):
	n = int(input())
	x = input()
	if len(set(x)) == 1:
		if x[0] == '1':
			print('1' * n)
		else:
			print('0' * n)
	elif x.count('1') > x.count('0'):
		print('1' * n)
	else:
		print('0' * n)


import sys
import collections as cc
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
tt = int(input())
for tc in range(tt):
	(n,) = I()
	s = input().strip()
	print(s[n - 1] * n)


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	if n == 1:
		print(s)
		t -= 1
		continue
	length = 2 * n - 1
	k = 0
	ans = ''
	for i in range(len(s) - n + 1):
		stringer = s[i:i + n]
		ans = ans + stringer[k]
		k += 1
	print(ans)
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	e = s[n - 1]
	print(e * n)


import math

def dtb(n):
	return bin(n).replace('0b', '')

def btd(n):
	return int(n, 2)
t = int(input())
for k in range(t):
	n = int(input())
	s = input()
	for i in range(0, 2 * n - 1, 2):
		print(s[i], end='')
	print()


from sys import stdin
input = lambda : stdin.readline().strip()
for _ in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	i = 0
	while i < n:
		ans += s[2 * i]
		i += 1
	print(ans)


def get_n_strings(string, n):
	return [string[i:n + i] for i in range(n)]

def str_similarity(string, n):
	strings = get_n_strings(string, n)
	result = ''
	for i in range(len(strings)):
		result += strings[i][i]
	return result

def print_strings(strings):
	for string in strings:
		print(string)
strings = []
similarity = []
for i in range(int(input())):
	n = int(input())
	similarity += [str_similarity(str(input()), n)]
print_strings(similarity)


t = int(input())
for i in range(t):
	n = int(input())
	num = input()
	print(num[n - 1] * n)


t = int(input())
for i in range(t):
	n = int(input())
	a = '@'
	s = input()
	a += s
	ans = ''
	x = a[n]
	for j in range(n):
		ans += x
	print(ans)


from sys import stdin, stdout
try:
	t = int(input())
	for i in range(t):
		n = int(input())
		s = input()
		l = list(s)
		l = [int(x) for x in l]
		ans = []
		c1 = l.count(0)
		c2 = l.count(1)
		if 0 not in l:
			for i in range(n):
				ans.append(1)
		elif 1 not in l:
			for i in range(n):
				ans.append(0)
		elif c1 > c2:
			for i in range(n):
				ans.append(0)
		else:
			for i in range(n):
				ans.append(1)
		for i in range(len(ans)):
			print(ans[i], end='')
		print()
except:
	pass


from pathlib import Path
import sys
import functools
import itertools
import re

def solve():
	T = int(input())
	for test in range(0, T):
		n = int(input())
		s = str(input())
		j = 0
		for i in range(0, n):
			if j < 2 * n:
				print(s[j], end='')
				j += 2
			else:
				break
		print()

def main():
	if Path('test.inp').exists():
		sys.stdin = open('test.inp', 'r')
	solve()
main()


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	for i in range(n):
		print(s[n - 1], end='')
	print()


t = int(input())
while t > 0:
	n = int(input())
	st = input()
	ans = ''
	for i in range(0, n):
		help = st[i:i + n]
		ans = ans + str(help[i])
	print(ans)
	t -= 1


for i in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	i = 0
	p = n
	while i < n:
		x = 0
		for j in s[i:p]:
			x |= int(j)
		ans += str(x)
		i += 1
		p += 1
	print(ans)


def read_int():
	return int(input().strip())

def read_ints():
	return list(map(int, input().strip().split()))

def read_floats():
	return list(map(float, input().strip().split()))

def read_str():
	return input().strip()

def solve_t():
	n = read_int()
	s = read_str()
	solution = list('0' * n)
	for i in range(n):
		solution[i] = s[i + i]
	print(''.join(solution))

def read_input():
	t = read_int()
	for i in range(t):
		solve_t()
read_input()


t = int(input())
for x in range(t):
	n = int(input())
	s = input()
	if n == 1:
		print(s)
	else:
		for i in range(0, len(s), 2):
			print(s[i], end='')
		print()


ts = input()
t = int(ts)
while t:
	t = t - 1
	ns = input()
	n = int(ns)
	str = input()
	ans = ''
	if n == 2:
		ans = ans + str[0] + str[2]
		print(ans)
		continue
	elif n == 1:
		print(str)
		continue
	else:
		for j in range(n):
			s = str[j:n + j]
			ans = ans + s[j]
	print(ans)


for _ in range(int(input())):
	n = int(input())
	s = input()
	cont = 0
	t = ''
	for i in range(n):
		t = t + s[cont]
		cont = cont + 2
	print(t)


from functools import reduce
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def inn():
	return int(input())
mo = 1000000007
for _ in range(int(input())):
	n = inn()
	s = input()
	ans = ''
	for i in range(0, len(s), 2):
		ans += s[i]
	print(ans)


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	s = input()
	j = 0
	a = ''
	for i in range(0, len(s), 2):
		a += s[i]
	print(a)


for i in range(int(input())):
	n = int(input())
	s = input()
	num = 0
	s1 = ''
	for i in range(n):
		s1 = s1 + s[n - 1]
	print(s1)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	s = input().strip()
	bad = []
	for i in range(n):
		val = int(s[i:i + n], 2)
		bad.append(2 ** n - val - 1)
	for i in range(n + 5):
		if i not in bad:
			break
	out = bin(i)[2:]
	while len(out) < n:
		out = '0' + out
	print(out)


for _ in range(int(input())):
	n = int(input())
	s = input()
	w = s[n - 1] * n
	print(w)


from sys import stdin, stdout

def input():
	return stdin.readline().strip()

def majority(arr):
	num_0 = 0
	num_1 = 0
	for c in arr:
		assert c in '01?'
		if c == '0':
			num_0 += 1
		if c == '1':
			num_1 += 1
	if num_0 > num_1:
		return '0'
	return '1'

def ans(N, S):
	mid = (2 * N - 1) // 2
	return S[mid] * N
T = int(input())
for t in range(T):
	N = int(input())
	s = input()
	print(ans(N, s))


t = int(input())
for _ in range(t):
	n = int(input())
	s = list(input())
	print(''.join(s[::2]))


for ad in range(int(input())):
	n = int(input())
	s = list(input())
	x = [0] * n
	for i in range(n):
		x[i] = s[2 * i]
	print(''.join(x))


t = int(input())
while t > 0:
	y = ''
	x = ''
	a = int(input())
	s = str(input())
	if a == 1:
		print(s)
	else:
		z = ''
		for i in range(0, len(s), 2):
			z += s[i]
		print(z)
	t -= 1


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		s = input()
		print(*[si for (i, si) in enumerate(s) if i % 2 == 0], sep='')
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
for i in range(n):
	m = int(input())
	a = str(input())
	bb = ''
	for kk in range(len(a)):
		if kk % 2 == 0:
			bb = bb + a[kk]
	print(bb)


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop, heapify
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
from itertools import accumulate
M = mod = 998244353

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
for _ in range(val()):
	n = val()
	s = input()
	print(s[n - 1] * n)


for _ in range(int(input())):
	n = int(input())
	s = input()
	m = len(s) // 2
	print(s[m] * n)


from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))

def solve():
	n = get_int()
	st = input()
	ans = ''
	for (ind, val) in enumerate(st[::2]):
		ans += val
	print(ans)

def main():
	solve()
TestCases = True
if TestCases:
	for i in range(get_int()):
		main()
else:
	main()


def sim(arr, n):
	s = arr[:n]
	k = 0
	for i in range(n):
		temp = arr[i:i + n]
		for i in range(n):
			if temp[i] == s[i]:
				break
			elif i >= k:
				k += 1
				s = str(s[:k] + temp[i + 1] + s[i + 2:])
				break
	return str(s)
t = int(input())
ans = []
for i in range(t):
	n = int(input())
	arr = input()
	ans.append(sim(arr, n))
for i in ans:
	print(i)


t = int(input())
while t:
	t -= 1
	n = int(input())
	a = input()
	b = []
	ans = ''
	for i in range(n):
		b.append(a[i:i + n])
	i = 0
	while i < n:
		one = 0
		zero = 0
		for j in range(len(b)):
			if b[j][i] == '1':
				one += 1
			else:
				zero += 1
		if one > zero:
			ans += '1'
		else:
			ans += '0'
		c = []
		for j in range(len(b)):
			if b[j][i] != ans[-1]:
				c.append(b[j])
		b = c
		i += 1
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ans = ''
	i = 0
	while i < n:
		temp = s[i:i + n]
		ans += temp[i]
		i += 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	s = input()
	z = 0
	o = 0
	for c in s:
		if c == '0':
			z += 1
		else:
			o += 1
	c = 1
	if z > o:
		c = 0
	for i in range(n):
		print(c, end='')
	print()


import sys
input = sys.stdin.readline
T = int(input())
for t in range(T):
	N = int(input())
	s = input()[:-1]
	w = ['0'] * N
	for i in range(N):
		w[i] = s[2 * i]
	print(''.join(w))


import sys
sys.setrecursionlimit(2147483647)

def solve(k, a):
	ans = ''
	for i in range(k):
		ans += a[i:i + k][i]
	return ans

def main():
	n = int(input())
	ans = []
	for _ in range(n):
		k = int(input())
		a = input()
		ans.append(solve(k, a))
	for r in ans:
		print(r)
main()


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	result = ''
	for j in range(n):
		result += s[2 * j]
	print(result)


for _ in range(int(input())):
	n = int(input())
	s = input()
	k = s.count('1')
	if k > 2 * n - 1 - k:
		print(n * '1')
	else:
		print(n * '0')


for fs in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	i = 0
	while i < len(s):
		ans = ans + s[i]
		i = i + 2
	print(ans)


cases = int(input())
for t in range(cases):
	n = int(input())
	s = input()
	print(s[::2])


t = int(input())
for asdas in range(t):
	n = int(input())
	s = str(input())
	a = ''
	for i in range(0, n):
		a += s[i + i]
	print(a)


def split(word):
	return list(word)

def output(s, n):
	out = ''
	i = 0
	string = list(s)
	while i < len(string):
		out += string[i]
		i += 2
	return out
T = int(input())
for i in range(1, T + 1):
	n = int(input())
	s = input()
	print(output(s, n))


for p in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	for i in range(n):
		ans += s[i:n + i][i]
	print(ans)


def solve(s, n):
	i = 0
	while i < 2 * n:
		print(s[i], end='')
		i += 2
	print()
t = int(input())
for test in range(t):
	n = int(input())
	s = input()
	solve(s, n)


for _ in range(int(input())):
	n = int(input())
	b = input()
	ans = ''
	ana = [[0, 0] for _ in range(n)]
	for i in range(n):
		ans += b[i:i + n][i]
	print(ans)


from os import path
import sys
from heapq import heappush, heappop
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input().rstrip()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')
file = 1

def solve():
	for _ in range(ii()):
		n = ii()
		s = si()
		s1 = ''
		x = []
		for i in range(n):
			x.append(s[i:i + n])
		for i in range(n):
			s1 += x[i][i]
		print(s1)
if file:
	if path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	else:
		input = sys.stdin.readline
solve()


import sys
input = sys.stdin.readline
I = lambda : list(map(str, input().split()))
(n,) = I()
n = int(n)
while n:
	(m,) = I()
	m = int(m)
	(arr,) = I()
	print(arr[m - 1] * m)
	n -= 1


try:
	for i in range(int(input())):
		n = int(input())
		s = str(input())
		st = '0' * n
		l = []
		for i in range(n):
			for j in range(n + i, n + i + 1):
				l.append(s[i:j])
		flag = 0
		sumv = 1
		val = 0
		for i in range(n):
			if sumv == len(l):
				flag = 1
			if flag == 1:
				break
			sumv = 1
			for x in range(len(l) - 1):
				if l[x][i] == l[x + 1][i]:
					sumv += 1
				val = i
		if sumv == len(l):
			flag = 1
		if flag == 1:
			strv = st[0:val]
			strv += l[0][val]
			strv += st[val + 1:]
			print(strv)
		else:
			print(st)
except Exception as e:
	pass


t = int(input())
while t:
	t += -1
	n = int(input())
	s = input()
	n1 = 2 * n - 1
	print(s[n1 // 2] * n)


from bisect import bisect_left
import os
import sys
from io import BytesIO, IOBase
from collections import Counter, defaultdict
from collections import deque
from functools import cmp_to_key
import math

def sin():
	return input()

def ain():
	return list(map(int, sin().split()))

def sain():
	return input().split()

def iin():
	return int(sin())
MAX = float('inf')
MIN = float('-inf')
MOD = 1000000007

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	s = set()
	for p in range(2, n + 1):
		if prime[p]:
			s.add(p)
	return s

def readTree(n, m):
	adj = [deque([]) for _ in range(n + 1)]
	for _ in range(m):
		(u, v) = ain()
		adj[u].append(v)
		adj[v].append(u)
	return adj

def solve(c1, c2, maxi1, maxi2):
	for i in range(1, maxi1 + 1):
		if i not in c1:
			return False
	for i in range(1, maxi2 + 1):
		if i not in c2:
			return False
	return True

def main():
	for _ in range(iin()):
		n = iin()
		s = sin()
		l = [0] * n
		for i in range(0, n):
			x = s[i:i + n]
			for i in range(n):
				l[i] += int(x[i])
		for i in range(n):
			if l[i] == n:
				l[i] = str(1)
			else:
				l[i] = str(0)
		print(''.join(l))
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')
if os.getcwd() == 'D:\\code':
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import os
import heapq
import sys, threading
import math
import operator
from collections import defaultdict
from io import BytesIO, IOBase
sys.setrecursionlimit(10 ** 5)
threading.stack_size(2 ** 27)

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

def inpt():
	return [int(k) for k in input().split()]

def main():
	for _ in range(int(input())):
		n = int(input())
		s = input()
		ans = ''
		ok = True
		for i in range(len(s) - 1):
			if s[i] != s[i + 1]:
				ok = False
				break
		ans = s[n - 1]
		ans = ans * n
		print(ans)
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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())

def solve(n, s):
	bs = set()
	for i in range(n):
		bs.add(~int(s[i:i + n], 2) & int('1' * n, 2))
	for i in range(100):
		if i not in bs:
			print(bin(i)[2:].zfill(n))
			break
for i in range(t):
	solve(int(input()), input())


def saurabh(strig):
	for i in range(0, len(strig), 2):
		print(strig[i], end='')
for i in range(int(input())):
	n = int(input())
	strig = input()
	saurabh(strig)
	print()


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ans = ''
	for x in range(0, len(s), 2):
		ans += s[x]
	print(ans)


import sys

def main():
	t = Iint()
	for _ in range(t):
		n = Iint()
		s = Istr()
		print(s[::2])
en = enumerate
FIO = 10
BUFSIZE = 8 * 1024

def Istr():
	return input()

def Iint():
	return int(input())

def Ilist():
	return list(map(int, input().split()))

def Imap():
	return map(int, input().split())

def Plist(li, s=' '):
	print(s.join(map(str, li)))

def debug(*args, c=6):
	pass
	print('\x1b[3{}m'.format(c), *args, '\x1b[0m', file=sys.stderr)
if not FIO:
	if __name__ == '__main__':
		main()
		exit()
else:
	from io import BytesIO, IOBase
	import os

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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	__ = input()
	s = input()[::2]
	print(s)


for test in range(int(input())):
	n = int(input())
	s = input()
	a = []
	check = [False] * n
	for i in range(n):
		a.append(s[i:i + n])
	ans = []
	for i in range(n):
		b = False
		for j in range(n):
			if not check[j] and (not b):
				ans.append(a[j][i])
				b = True
			if b and a[j][i] == ans[i]:
				check[j] = True
		if not b:
			ans.append('1')
	for i in range(n):
		print(ans[i], end='')
	print()


for tt in range(int(input())):
	n = int(input())
	s = list(input())
	o = s.count('1')
	z = s.count('0')
	if o > z:
		print('1' * n)
	elif o < z:
		print('0' * n)


for _ in range(int(input())):
	(n,) = map(int, input().split())
	print(n * input()[n - 1])


def iin():
	return int(input())

def lin():
	return list(map(int, input().split()))

def main():
	T = iin()
	for t in range(T):
		n = iin()
		a = input()
		ans = a[::2]
		print(ans)
main()


def solve():
	n = int(input())
	s = input()
	for i in s[::2]:
		print(i, end='')
	print()
t = int(input())
for _ in range(t):
	solve()


t = int(input())
for cas in range(t):
	n = int(input())
	s = input()
	nOne = nZero = 0
	for i in range(n):
		if s[i] == '1':
			nOne = nOne + 1
		else:
			nZero = nZero + 1
	oneAll = zeroAll = True
	l = 0
	r = n - 1
	while r < 2 * n - 2:
		if nOne == 0:
			oneAll = False
			break
		elif nZero == 0:
			zeroAll = False
			break
		if s[l] == '1':
			nOne = nOne - 1
		else:
			nZero = nZero - 1
		l = l + 1
		if s[r + 1] == '1':
			nOne = nOne + 1
		else:
			nZero = nZero + 1
		r = r + 1
	if nOne == 0:
		oneAll = False
	elif nZero == 0:
		zeroAll = False
	if oneAll:
		print('1' * n)
	else:
		print('0' * n)


test = int(input())
for _ in range(test):
	n = int(input())
	s = input()
	print(s[n - 1] * n)


for _ in range(int(input())):
	n = int(input())
	s = input()
	res = ''
	for i in range(1, n + 1):
		res += s[i + i - 1 - 1]
	print(res)


for _ in range(int(input())):
	n = int(input())
	s = input()
	x = ''
	for j in range(len(s)):
		if j % 2 == 0:
			x += s[j]
	print(x)


t = int(input())
for _ in range(t):
	n = int(input())
	s = list(input())
	ans = []
	for i in range(n):
		ans.append(s[i + i])
	print(''.join(ans))


t = int(input())
i = 0
while i < t:
	n = int(input())
	a = list(input())
	j = 0
	k = []
	while j < n:
		k.append(a[j + j])
		j += 1
	print(''.join(k))
	i += 1


from sys import stdin
input = stdin.readline

def A():
	t = int(input())
	for _ in range(t):
		n = int(input())
		s = input()
		print(s[n - 1] * n)
A()


tc = int(input())
for _ in range(tc):
	n = int(input())
	s = input()
	k = 0
	result = ''
	for i in range(n):
		result += s[i + k]
		k += 1
	print(result)


tcase = int(input())
for _ in range(tcase):
	n = int(input())
	s = input()
	print(s[n - 1] * n)


def calcSimilarity(seq, n):
	similar = ''
	for i in range(n):
		similar += seq[i * 2]
	return similar
t = int(input())
result = ''
for i in range(t):
	n = int(input())
	seq = input()
	res = calcSimilarity(seq, n)
	result += res + '\n'
print(result)


for _ in range(int(input())):
	n = int(input())
	l = input()
	s = ['0'] * n
	for i in range(n):
		s[i] = l[2 * i]
	print(*s, sep='')


def main():
	t = int(input())
	while t:
		t -= 1
		n = int(input())
		s = input()
		if n == 1:
			print(s[0])
		elif n == 2:
			print(s[0] + s[2])
		else:
			cnt = 1
			gg = False
			for e in range(1, len(s)):
				if s[e] == s[e - 1]:
					cnt += 1
				else:
					cnt = 1
				if cnt == n:
					gg = True
					break
			if gg:
				print(s[e] * n)
			else:
				print(s[0] * n)
main()


def solve():
	n = int(input())
	s = input()
	t = []
	for i in range(n):
		t.append(s[i * 2])
	print(''.join(t))
t = int(input())
for _ in range(t):
	solve()


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	a = [s[i:i + n] for i in range(n)]
	res = ''
	for i in range(n):
		count = 0
		index = set()
		for j in range(len(a)):
			if a[j][i] == '1':
				count += 1
				index.add(j)
		if count == 0:
			res += '0' * (n - len(res))
			break
		else:
			res += '1'
			a = [a[i] for i in range(len(a)) if i not in index]
	print(res)


t = input()
t = int(t)
while t > 0:
	n = input()
	s = input()
	d = 1
	for i in s:
		if d % 2 != 0:
			print(i, end='')
		d = d + 1
	t = t - 1
	print()


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	a = ''
	num = 0
	for i in range(n):
		a += s[i:i + n][num]
		num += 1
	print(a)


t = int(input())
for _ in range(t):
	n = int(input())
	S = input()
	T = S[n - 1] * n
	print(T)


t_case = int(input())
for _ in range(t_case):
	n = int(input())
	st = input()
	for i in range(n):
		print(st[n - 1], end='')
	print()


for _ in range(int(input())):
	n = int(input())
	s = input()
	one = []
	zero = []
	dic = {}
	for i in range(len(s)):
		if n + i > len(s):
			break
		else:
			temp = s[i:n + i]
			one.append(temp.count('1'))
			zero.append(temp.count('0'))
	if max(one) >= max(zero):
		print('1' * n)
	else:
		print('0' * n)


t = int(input())
for j in range(t):
	n = int(input())
	s = input()
	ans = [0] * n
	for i in range(n):
		ans[i] = s[i:][i]
	print(''.join(ans))


def read():
	return [int(x) for x in input().split()]
(cas,) = read()
for _ in range(cas):
	(n,) = read()
	s = input()
	print(''.join((s[2 * i] for i in range(n))))


t = int(input())
results = []
for i in range(t):
	n = int(input())
	s = input()
	res = ''
	for nn in range(n):
		sb = s[nn:n + nn]
		res += sb[nn]
	results.append(res)
for result in results:
	print(result)


for _ in range(int(input())):
	n = int(input())
	s = input()
	x = s.count('0')
	y = s.count('1')
	if x > y:
		print('0' * n)
	else:
		print('1' * n)


t = int(input())
for o in range(t):
	n = int(input())
	s = list(input())
	print(s[n - 1] * n)


import sys
lines = sys.stdin.read().splitlines()
lincnt = -1

def input():
	nonlocal lincnt
	lincnt += 1
	return lines[lincnt]
for _ in range(int(input())):
	n = int(input())
	s = input()
	print(n * s[n - 1])


import math
N = int(input())
for i in range(N):
	n = int(input())
	a = list(input())
	l = a[::2]
	print(''.join(l))


T = int(input())
for _ in range(T):
	N = int(input())
	A = input()
	A = list(A)
	ans = []
	flag = 1
	for i in range(2 * N - 1):
		if flag == 1:
			flag = 0
			ans.append(A[i])
		else:
			flag = 1
	print(*ans, sep='')


for _ in range(int(input())):
	n = int(input())
	s = input()
	i = 0
	w = ''
	j = 2
	while i < 2 * n - 1:
		if i + 1 & 1:
			w += s[i]
		i += 1
	print(w)


for _ in range(int(input())):
	n = int(input())
	s = input()
	com = s[n - 1]
	ns = str()
	for i in range(n):
		ns += com
	print(ns)


t = int(input())
for _ in [0] * t:
	n = int(input())
	s = input()
	lst = []
	for i in range(n):
		lst.append([])
		for j in range(n):
			lst[-1].append(s[j + i])
	w = ''
	for i in range(n):
		w = w + lst[i][i]
	print(w)


import os
import random
import sys
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	a = [None] * n
	for i in range(n):
		a[i] = s[i * 2]
	print(''.join(a))


for tt in range(int(input())):
	n = int(input())
	s = input()
	b = []
	for i in range(n, len(s) + 1):
		k = s[i - n:i]
		for j in range(len(k)):
			if k[j] == '0':
				b.append(j)
	a = list(set(b))
	c = []
	for i in range(0, n):
		if i in a:
			c.append('0')
		else:
			c.append('1')
	print(''.join(c))


import sys
sys.setrecursionlimit(10000)
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ans = ''
	for i in range(n):
		ans += s[n - 1]
	print(ans)


for t in range(int(input())):
	n = int(input())
	s = input()
	out = ['0'] * n
	aI = 0
	for i in range(n):
		sub = s[i:i + n]
		flag = True
		for j in range(aI):
			if sub[j] == out[j]:
				flag = False
				break
		if flag:
			out[aI] = sub[aI]
			aI += 1
	print(''.join(out))


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	ans = s[n - 1] * n
	print(ans)
	t = t - 1


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	ans = ''
	for i in range(n):
		ans += s[i:n + i][i]
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	a = input().strip()
	result = ''
	u = 0
	for j in range(n):
		result += a[u]
		u += 2
	print(result)


t = int(input().split()[0])
for case in range(t):
	n = int(input().split()[0])
	s = input().split()[0]
	ans = ''
	for c in range(0, 2 * n - 1, 2):
		ans += s[c]
	print(ans)


def solve():
	n = int(input())
	s = input()
	(i1, i2, r) = (0, n, '')
	while i1 < n:
		tmp = s[i1:i2]
		r += tmp[i1]
		i1 += 1
		i2 += 1
	return r
for _ in range(int(input())):
	print(solve())


t = int(input())
l = []
n = []
for i in range(t):
	m = int(input())
	n += [m]
	p = input()
	l += [p]
for i in range(t):
	s = []
	a = ''
	for j in range(n[i]):
		s += [l[i][j:j + n[i]]]
	for j in range(n[i]):
		b = 0
		a += s[j][j]
	print(a)


t = int(input())
while t:
	n = int(input())
	s = input()
	ans = ''
	if len(s) == 1:
		print(s)
	else:
		for i in range(0, len(s), 2):
			ans += s[i]
		print(ans)
	t -= 1


from sys import stdin
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1000000000.0) + 7
inf = float('inf')
from bisect import *
(t,) = gil()
for _ in range(t):
	(n,) = gil()
	s = gbs()
	w = [1] * n
	for i in range(n):
		for j in range(n):
			w[i] = w[i] & s[i + j]
	for k in w:
		print(k, end='')
	print()


for _ in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	for i in range(n):
		a = 1
		for j in range(i, i + n):
			a = a & int(s[j])
		ans += str(a)
	print(ans)


for _ in range(int(input())):
	n = int(input())
	print(*[i for (ind, i) in enumerate(input()) if ind % 2 == 0], sep='')


import sys
from functools import reduce
from collections import Counter
import time
import datetime
from math import sqrt, gcd

def ip():
	return int(sys.stdin.readline())

def sip():
	return sys.stdin.readline()

def mip():
	return map(int, sys.stdin.readline().split())

def mips():
	return map(str, sys.stdin.readline().split())

def lip():
	return list(map(int, sys.stdin.readline().split()))

def matip(n, m):
	lst = []
	for i in range(n):
		arr = lip()
		lst.append(arr)
	return lst

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def minJumps(arr, n):
	jumps = [0 for i in range(n)]
	if n == 0 or arr[0] == 0:
		return float('inf')
	jumps[0] = 0
	for i in range(1, n):
		jumps[i] = float('inf')
		for j in range(i):
			if i <= j + arr[j] and jumps[j] != float('inf'):
				jumps[i] = min(jumps[i], jumps[j] + 1)
				break
	return jumps[n - 1]

def dic(arr):
	return Counter(arr)

def check_prime(n):
	if n < 2:
		return False
	for i in range(2, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
t = ip()
while t:
	t -= 1
	n = ip()
	s = sip()
	if n == 1:
		print(s)
	elif n == 2:
		print(s[1] + s[1])
	else:
		k = s[(2 * n - 1) // 2]
		ans = k * n
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	a = input()
	s = ''
	l = []
	for i in range(n):
		l.append(a[i:n + i])
	for i in range(n):
		s += l[i][i]
	print(s)


def dot(a, b):
	lst = []
	for i in range(len(a)):
		if a[i] == '1' and b[i] == '1':
			x = 1
		else:
			x = 0
		lst += [str(x)]
	return ''.join(lst)
for _ in range(int(input().strip())):
	n = int(input().strip())
	binn_str = input().strip()
	temp = binn_str[:n]
	for i in range(1, n):
		temp = dot(temp, binn_str[i:n + i])
	print(temp)


from math import gcd
from collections import Counter
import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	s = input().rstrip()
	if n == 1:
		print(s)
	else:
		arr = []
		ans = ''
		for i in range(n):
			temp = s[i:n + i]
			arr.append(temp)
		j = 0
		for i in range(len(arr)):
			ans += arr[i][j]
			j += 1
		print(ans)


n = int(input())
for i in range(n):
	x = int(input())
	z = input()
	c = 0
	d = 0
	for i in z:
		if i == '0':
			c += 1
		else:
			d += 1
	if c > d:
		print(x * '0')
	else:
		print(x * '1')


tests = int(input())
w = ''
while tests > 0:
	(n, s) = (int(input()), input())
	for i in range(0, len(s), 2):
		w += s[i]
	print(w)
	w = ''
	tests -= 1


from __future__ import division, print_function
from sys import stdin, stdout
import bisect
import math
import heapq
i_m = 9223372036854775807

def inin():
	return int(input())

def stin():
	return input()

def spin():
	return map(int, stin().split())

def lin():
	return list(map(int, stin().split()))

def matrix(n):
	return [list(map(int, input().split())) for i in range(n)]

def string2intlist(s):
	return list(map(int, s))

def calculate_sum(a, N):
	m = N / a
	sum = m * (m + 1) / 2
	ans = a * sum
	return ans

def series(N):
	return N * (N + 1) // 2

def count2Dmatrix(i, list):
	return sum((c.count(i) for c in list))

def modinv(n, p):
	return pow(n, p - 2, p)

def GCD(x, y):
	x = abs(x)
	y = abs(y)
	if min(x, y) == 0:
		return max(x, y)
	while y:
		(x, y) = (y, x % y)
	return x

def LCM(x, y):
	return x * y // GCD(x, y)

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def isprime(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True
prime = []

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j
for _ in range(inin()):
	n = inin()
	s = stin()
	for i in range(n):
		print(s[n - 1], end='')
	print()


import io, os
from collections import deque
import bisect
RL = lambda : list(map(int, input().split(' ')))
T = int(input())
for _ in range(T):
	n = int(input())
	s = input()
	ans = s[n - 1] * n
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	st = input()
	ch = st[n - 1] * n
	print(ch)


n = int(input())
for i in range(n):
	k = int(input())
	s = input()
	ans = ''
	count = 0
	for i in range(len(s) - k + 1):
		ans += s[i + count]
		count += 1
	print(ans)


from sys import *
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	s = input()
	w = []
	for i in range(0, 2 * n - 1, 2):
		w.append(s[i])
	w = ''.join(w)
	stdout.write(w + '\n')


for _ in range(int(input())):
	n = int(input())
	l = list(input())
	res = []
	for i in range(len(l)):
		if i % 2 == 0:
			res.append(l[i])
	print(*res, sep='')


p = int(input())
for i in range(p):
	x = int(input())
	s = input()
	stringp = ''
	for j in range(x):
		stringp += str(s[j * 2])
	print(stringp)


t = int(input())
while t:
	n = int(input())
	s = input()
	if n == 1:
		print(s)
	else:
		ans = ''
		for i in range(n):
			x = s[i:n + i + 1]
			ans += x[i]
		print(ans)
	t -= 1


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	idx = 0
	for i in range(n):
		print(s[i + idx], end='')
		idx += 1
	print('')
	t -= 1


T = int(input())
for _ in range(T):
	n = int(input())
	S = str(input())
	if n == 1:
		print(S[0])
		continue
	if S[n - 1] == '0':
		ans = '0' * n
	else:
		ans = '1' * n
	print(ans)


import sys
input = sys.stdin.readline

def get_binary_string(n, s):
	return ''.join([s[2 * i] for i in range(n)])
num_tests = int(input())
for _ in range(num_tests):
	n = int(input())
	s = input()
	print(get_binary_string(n, s))


for i in range(int(input())):
	n = int(input())
	s = input()
	a = ''
	j = 0
	for i in range(n):
		a = a + s[i + j]
		j = j + 1
	print(a)


from sys import stdin, stdout
from collections import Counter, deque
from queue import PriorityQueue
import math
helperConstants = True
helperUtilityFunctions = True

def input():
	return stdin.readline().strip()
if helperConstants:
	YES = 'YES'
	NO = 'NO'
	yes = 'yes'
	no = 'no'
	true = 'true'
	false = 'false'
	FALSE = 'FALSE'
	TRUE = 'TRUE'
	IMPOSSIBLE = 'IMPOSSIBLE'
	POSSIBLE = 'POSSIBLE'
	INF = float('inf')
if helperUtilityFunctions:

	def getInputArray():
		return list(map(int, input().split()))

	def getIntegerInputs():
		return map(int, input().split())

	def getInputIntegerMatrix(n):
		matrix = []
		for i in range(n):
			matrix.append(list(map(int, input().split())))
		return matrix

	def getInputStringMatrix(n):
		matrix = []
		for i in range(n):
			matrix.append(input())
		return matrix

	def outputIntegerMatrix(matrix):
		for i in range(len(matrix)):
			print(*matrix[i])

	def outputStringMatrix(matrix):
		for i in range(len(matrix)):
			print(matrix[i])

	def kickstartoutput(testcase, *outputs):
		print('Case #%d:' % testcase, *outputs)

def solve(t):
	n = int(input())
	s = input()
	char = s[n - 1]
	print(char * n)
for t in range(int(input())):
	solve(t + 1)


from sys import stdin
inp = lambda : stdin.readline().strip()
t = int(inp())
for _ in range(t):
	n = int(inp())
	s = inp()
	ans = []
	for i in s[::2]:
		ans.append(i)
	print(''.join(ans))


import sys
import math
import collections
import operator as op
from collections import deque
from math import gcd, inf, sqrt, pi, cos, sin, ceil, log2
from bisect import bisect_right, bisect_left
from functools import reduce
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)

def factorial(n):
	if n == 0:
		return 1
	return n * factorial(n - 1)

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return list(factors)

def sumDigits(no):
	return 0 if no == 0 else int(no % 10) + sumDigits(int(no / 10))
MOD = 1000000007
PMOD = 998244353
N = 10 ** 5
T = 1
T = int(stdin.readline())
for _ in range(T):
	n = int(stdin.readline())
	a = str(stdin.readline().strip('\n'))
	ans = ''
	for i in range(0, 2 * n, 2):
		ans += a[i]
	print(ans)


T = int(input())
for _ in range(T):
	n = int(input())
	S = str(input())
	print(S[n - 1] * n)


for test in range(int(input())):
	n = int(input())
	s = input()
	a = ''
	for i in range(0, len(s), 2):
		a = a + s[i]
		if len(a) == n:
			break
	print(a)


t = input()
t = int(t)
for k in range(t):
	n = input()
	s = input()
	s = str(s)
	o = ''
	for i in range(int(n)):
		o = o + s[0]
		s = s[2:]
	print(o)


t = int(input())
result = []
for i in range(t):
	n = int(input())
	s = str(input())
	a = s[n - 1] * n
	result.append(a)
for i in result:
	print(i)


for t in range(int(input())):
	n = int(input())
	s1 = input()
	s2 = s1[n - 1] * n
	print(s2)


def solve():
	n = int(input())
	s = input()
	w = []
	temp = []
	j = 0
	for i in range(0, n):
		temp.append(s[j:j + n])
		j += 1
	for i in range(0, n):
		w.append(temp[i][i])
	print(''.join(w))
t = int(input())
while t:
	solve()
	t -= 1

def solve():
	n = int(input())
	s = input()
	w = ''
	j = 0
	for i in range(0, n):
		print(s[j:j + n])
		j += 1


from sys import stdin, stdout

def gmi():
	return map(int, stdin.readline().strip().split())

def gms():
	return map(str, stdin.readline().strip().split())

def gari():
	return list(map(int, stdin.readline().strip().split()))

def gars():
	return list(map(int, stdin.readline().strip().split()))

def gs():
	return stdin.readline().strip()

def gls():
	return list(stdin.readline())

def gi():
	return int(stdin.readline())

def rl(ar):
	return range(len(ar))
t = gi()
while t:
	t -= 1
	n = gi()
	s = gs()
	ans = ''
	for i in range(n):
		ans += s[i:i + n][i]
	print(ans)


for i in range(int(input())):
	n = int(input())
	s = input()
	a = []
	g = int(len(s) / 2)
	if len(s) == 1:
		print(s)
	else:
		print(s[g] * n)


t = int(input())
for i in range(t):
	n = int(input())
	str = input()
	print(n * str[n - 1])


import sys
import math
from collections import defaultdict, Counter
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	s1 = ''
	for j in range(0, 2 * n - 1, 2):
		s1 += s[j]
	print(s1)


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	w = ''
	for j in range(0, len(s), 2):
		w += s[j]
	print(w)
	w = ''


ans = []
for x in range(int(input())):
	test_list = []
	l = []
	m = int(input())
	n = input()
	for y in n:
		v = int(y)
		test_list.append(v)
	res = [test_list[i] for i in range(len(test_list)) if i % 2 == 0]
	for x in res:
		y = str(x)
		l.append(y)
	abhi = ''
	d = abhi.join(l)
	ans.append(d)
for y in ans:
	print(y)


for item in range(int(input())):
	n = int(input())
	s = input()
	print(s[0:2 * n:2])


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
for _ in range(iinput()):
	n = iinput()
	s = input()
	ans = ''
	j = 0
	for i in range(n):
		ans += s[i + j]
		j += 1
	print(ans)


import sys
import math
from math import *
from collections import Counter, defaultdict

def main():
	n = int(input())
	s = input()
	ans = ''
	for i in range(2 * n - 1):
		if i % 2 == 0:
			ans += s[i]
	print(ans)
for i in range(int(input())):
	main()


t = int(input())
while t:
	t -= 1
	n = int(input())
	s = input()
	a = 0
	for i in range(n):
		print(s[a], end='')
		a += 2
	print()


def getSimilarity(n, arr):
	strReturn = ''
	for i in range(0, 2 * n - 1, 2):
		strReturn += arr[i]
	return strReturn
testCases = int(input())
for i in range(testCases):
	n = int(input())
	arr = list(input())
	print(getSimilarity(n, arr))


t = int(input())
for _ in range(t):
	n = int(input())
	string = input()
	print(string[n - 1] * n)


import math, sys, itertools
wtf = sys.stdin.read()
wtf = wtf.strip().split('\n')
for t in [wtf[i:i + 2] for i in range(1, len(wtf), 2)]:
	n = int(t[0])
	tmp = [t[1].count('0'), t[1].count('1')]
	print('0' * n if tmp[0] > tmp[1] else '1' * n)


import math
from collections import Counter
T = int(input())
for t in range(T):
	n = int(input())
	s = input()
	l = len(s)
	c = 0
	ans = ''
	for i in range(0, l - n + 1):
		ss = s[i:i + n + 1]
		ans += ss[c]
		c += 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	c = 0
	for i in range(0, len(s) - n + 1):
		d = s[i:i + n]
		ans += d[c]
		c += 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	s = input()
	z = dict.fromkeys(range(n), [0, 0])
	for i in range(n):
		s1 = s[i:i + n]
		for j in range(n):
			if s1[j] == '0':
				z[j][0] += 1
			else:
				z[j][1] += 1
	res = ''
	for i in range(n):
		if z[i][0] > z[i][1]:
			res += '0'
		else:
			res += '1'
	print(res)


def string_sim(n, s):
	temp = ''
	for i in range(0, len(s), 2):
		temp += s[i]
	return temp
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	res = string_sim(n, s)
	print(res)


numCase = int(input())
for x in range(numCase):
	total = []
	final = ''
	loop = 0
	n = int(input())
	s = input()
	for cd in range(n):
		total.append(0)
	for i in range(n):
		pos = False
		string = s[i:i + n]
		for j in range(n):
			cut = string[j]
			totalCut = total[j]
			if cut == str(totalCut):
				pos = True
		if pos == False:
			for a in range(n):
				cut = string[a]
				totalCut = total[a]
				if cut == '1' and totalCut == 0:
					total[i + a] = 1
					break
		if loop == 0:
			loop += 1
			continue
	for x in total:
		final += str(x)
	print(final)


n = int(input())
l = list()
g = list()
x = list()

def deal(main, b):
	string = '0' * b
	z = 0
	for i in range(0, b):
		q = main[i]
		print(q[i], end='')
	print('')

def process(x, y):
	main = list()
	l = 0
	r = int(x)
	for i in range(int(x)):
		main.append(y[l:r])
		l += 1
		r += 1
	deal(main, int(x))
for i in range(n):
	l.append(input())
	g.append(input())
for i in range(n):
	process(str(l[i]), str(g[i]))


x = int(input())
for z in range(x):
	n = int(input())
	l = input()
	i = 0
	while i < 2 * n:
		print(l[i], end='')
		i += 2
	print()


import math
from collections import deque
from sys import stdin, stdout
from string import ascii_letters
letters = ascii_letters[:26]
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	arr = input().strip()
	print(arr[::2])


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	z = list()
	z = list(map(int, s))
	y = list()
	x = list()
	index = 0
	for i in range(n):
		y.append(z[i:n + i])
	for j in range(n):
		count = 0
		for k in range(n):
			if y[j][0] == y[j][k]:
				count = count + 1
		if count == n:
			index = j
	for m in range(n):
		x.append(str(y[index][index]))
	print(''.join(x))
	t = t - 1


from collections import defaultdict as dd
from sys import stdin, stdout
for t in range(int(stdin.readline().strip())):
	n = int(stdin.readline().strip())
	a = input()
	s = ''
	for i in range(n):
		s = s + a[n - 1]
	print(s)


def readA():
	return list(map(int, input().split()))

def intPut():
	return int(input())

def arrIt(arr, n):
	result = 0
	for i in arr:
		result += i
	return result

def solve(s, n):
	low = 0
	high = n
	bound = 2 * n - 1
	lst = []
	result = ''
	temp = s
	while low < n:
		result += temp[low]
		low += 1
		temp = s[low:]
	return result
for _ in range(intPut()):
	n = intPut()
	s = input()
	print(solve(s, n))


t = int(input())
for _ in range(t):
	markzero = False
	markone = False
	n = int(input())
	l1 = input()
	if l1.count('0'):
		print(''.join([l1[n - 1] for i in range(n)]))
	else:
		print(''.join([l1[n - 1] for i in range(n)]))


import sys, math, cmath, time
start_time = time.time()

def solve():
	n = inp()
	s = insr()
	q = [s[i] for i in range(0, len(s), 2)]
	print(''.join(q))

def main():
	global tt
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(t):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
		sys.stdout.close()

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	return input().strip()

def invr():
	return map(int, input().split())

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def counter_elements(a):
	q = dict()
	for i in range(len(a)):
		if a[i] not in q:
			q[a[i]] = 0
		q[a[i]] = q[a[i]] + 1
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q

def factors(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
			q.append(n // i)
	return list(sorted(list(set(q))))

def prime_factors(n):
	q = []
	while n % 2 == 0:
		q.append(2)
		n = n // 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			q.append(i)
			n = n // i
	if n > 2:
		q.append(n)
	return list(sorted(q))

def transpose(a):
	(n, m) = (len(a), len(a[0]))
	b = [[0] * n for i in range(m)]
	for i in range(m):
		for j in range(n):
			b[i][j] = a[j][i]
	return b

def factorial(n, m=1000000007):
	q = 1
	for i in range(n):
		q = q * (i + 1) % m
	return q
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


for _ in range(int(input())):
	n = int(input())
	s = input()
	result = [s[i] for i in range(0, 2 * n - 1, 2)]
	print(''.join(result))


t = int(input())
for i in range(t):
	n = int(input())
	binary = input()
	if n > len(binary):
		bigger = n - len(binary)
		res = binary[n - 1] * bigger
		print(res)
		continue
	else:
		print(binary[n - 1] * n)
		continue


t = int(input())
for i in range(t):
	n = int(input())
	a = input()
	array = []
	for j in range(2 * n - 1):
		if (j + 1) % 2 != 0:
			array.append(a[j])
	string = ''
	for j in range(len(array)):
		string += array[j]
	print(string)


for i in range(int(input())):
	n = int(input())
	Str = input()
	w = ''
	for j in range(0, 2 * n - 1):
		if j % 2 == 0:
			w += Str[j]
	print(w)


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	o = s.count('0')
	on = ''
	z = s.count('1')
	ze = ''
	if o > z:
		for i in range(n):
			on += '0'
		print(on)
	else:
		for j in range(n):
			ze += '1'
		print(ze)


from collections import Counter, defaultdict, deque
import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	s = input().strip()
	d = s[len(s) // 2]
	print(n * d)
tt = int(input())
for test in range(tt):
	solve()


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	similar = s[n - 1] * n
	print(similar)


t = int(input())
for ii in range(t):
	n = int(input())
	s = input()
	l = [s[0]]
	nex = 0
	for i in range(1, n):
		if s[i + nex] == l[nex]:
			continue
		else:
			l.append(s[i + nex + 1])
			nex += 1
	while len(l) != n:
		l.append('0')
	print(''.join(l))


def myfunc():
	n = int(input())
	s = input()
	a0 = [0] * n
	a1 = [0] * n
	l = len(s) - 1
	i = 0
	while l - i + 1 >= n:
		for j in range(i, i + n):
			if s[j] == '0':
				a0[j - i] += 1
			else:
				a1[j - i] += 1
		i += 1
	s2 = []
	tmp = len(s) - n + 1
	for i in range(n):
		if a1[i] == tmp:
			s2.append('1')
		else:
			s2.append('0')
	print(''.join(s2))
t = int(input())
for _ in range(t):
	myfunc()


t = int(input())
while t:
	n = int(input())
	s = input()
	ans = '0' * n
	lis1 = list(ans)
	for i in range(0, n):
		temp = s[i:i + n]
		lis2 = list(temp)
		lis1[i] = lis2[i]
	ans = ''.join(lis1)
	print(ans)
	t -= 1


import sys
from math import sqrt, gcd, ceil, log, floor
from bisect import bisect, bisect_left
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
input = sys.stdin.readline
read = lambda : list(map(int, input().strip().split()))
MOD = 10 ** 9 + 7

def main():
	ans_ = []
	for _ in range(int(input())):
		n = int(input())
		s = input().strip()
		t = ''
		for i in range(0, 2 * n - 1, 2):
			t += s[i]
		ans_.append(t)
	print('\n'.join(ans_))
main()


test = int(input())

def run_case():
	n = int(input())
	s = input()
	i = 0
	ans = []
	while i < len(s):
		ans.append(s[i])
		i = i + 2
	str1 = ''
	for ele in ans:
		str1 += ele
	print(str1)
while test > 0:
	test = test - 1
	run_case()


for i in range(int(input())):
	n = int(input())
	s = input()
	list = []
	for i in range(n):
		list.append(s[2 * i])
	listToStr = ''.join([str(elem) for elem in list])
	print(listToStr)


t = int(input())
a = []
for i in range(t):
	t2 = []
	n = []
	t1 = int(input())
	t2 = list(input())
	for j in range(t1):
		b = []
		b = t2[j:t1 + j]
		if len(b) == 0:
			n.append(t2[0])
		else:
			n.append(b[j])
	a.append(''.join(n))
for i in a:
	print(i)


import sys
import math
import collections
from sys import stdin, stdout, setrecursionlimit
import bisect as bs
setrecursionlimit(2 ** 20)
M = 10 ** 9 + 7
T = int(stdin.readline())
for _ in range(T):
	n = int(stdin.readline())
	s = stdin.readline().strip('\n')
	a = ''
	for i in range(n):
		a = a + s[2 * i]
	print(a)


def findSim(n, s):
	subnum = 0
	wi = 0
	w = []
	while wi < n:
		w.append(s[subnum + wi])
		wi = wi + 1
		subnum = subnum + 1
	return ''.join(w)
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	print(findSim(n, s))


for s in [*open(0)][2::2]:
	n = len(s) // 2
	print(s[n - 1] * n)


t = int(input())
for i in range(t):
	n = int(input())
	s = list(input())
	for j in range(0, len(s), 2):
		print(s[j], end='')
	if i != t - 1:
		print()


t = int(input())
while t > 0:
	t -= 1
	string = ''
	n = int(input())
	A = input()
	start = 0
	end = n - 1
	i = 0
	while end < len(A):
		B = A[start:end + 1]
		string += B[i]
		start += 1
		end += 1
		i += 1
	print(string)


for p in range(int(input())):
	c1 = 0
	summ = 0
	n = int(input())
	s = input()
	c = s.count('1')
	t = s.count('0')
	if c >= t:
		print('1' * n)
	else:
		print('0' * n)


for _ in range(int(input())):
	n = int(input())
	s = str(input())
	s1 = ''
	for i in range(n):
		s1 += s[n - 1]
	print(s1)


for t in range(int(input())):
	n = int(input())
	s = str(input())
	ans = s[n - 1] * n
	print(ans)


for _ in range(int(input())):
	number = int(input())
	name = input()
	print(name[number - 1] * number)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	sub = []
	final = '0' * n
	for i in range(n):
		sub.append(s[i:i + n])
	for i in range(len(sub)):
		if sub[i] == '1' * n or sub[i] == '0' * n:
			print(sub[i])
			break
		if i == len(sub) - 1:
			print(final)


tn = int(input())
for ti in range(tn):
	n = int(input())
	s = input()
	ans = ''.join([s[i * 2] for i in range(n)])
	print(ans)


import sys

def similar(s1, s2):
	for x in range(len(s1)):
		if s1[x] == s2[x]:
			return True
	return False
numCases = int(input())
for x in range(numCases):
	n = int(input())
	s = input()
	s = s.strip()
	w = s[0::2]
	print(w)


t = int(input())
for r in range(t):
	n = int(input())
	s = input()
	start = 0
	ans = []
	while start < len(s):
		ans.append(s[start])
		start += 2
	print(''.join(ans))


for i in range(int(input())):
	input()
	print(input()[::2])


import sys
from collections import defaultdict as dd
from collections import Counter as cc
from queue import Queue
import math
import itertools
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
for _ in range(int(input())):
	q = int(input())
	w = input()
	k = ''
	for i in range(0, 2 * q - 1, 2):
		k += w[i]
	print(k)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	s = list(input().strip())
	r = []
	for i in range(0, 2 * n - 1, 2):
		r.append(s[i])
	print(''.join(r))


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	s = input()
	idx = int((2 * n - 1) / 2)
	ch = s[idx]
	if ch == '0':
		ans = '0' * n
	else:
		ans = '1' * n
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	x = input()
	z = ''
	for i in range(n):
		m = x[i:i + n]
		z += m[i]
	print(z)


for _ in ' ' * int(input()):
	n = int(input())
	s = input()
	print(s[n - 1] * n)


t = int(input())

def get_result(n, str_):
	count_zero = 0
	count_one = 0
	for ch in str_:
		if '0' == ch:
			count_zero += 1
		else:
			count_one += 1
	return '1' * n if count_one >= count_zero else '0' * n
results = []
for _ in range(t):
	n = int(input())
	str_ = input()
	results.append(get_result(n, str_))
print('\n'.join(results))


t = int(input())
for _ in range(t):
	ni = int(input())
	si = input()
	print(si[0::2])


def answer(n, s):
	c = s[n - 1]
	return c * n
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	print(answer(n, s))


for i in range(int(input())):
	n = int(input())
	s = input()
	out = []
	out.append(s[0])
	for i in range(1, len(s)):
		if i % 2 == 0:
			out.append(s[i])
	for ele in out:
		print(ele, end='')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	bin_string = input()
	ans = [0] * n
	for i in range(n):
		ans[i] = bin_string[2 * i]
	print(''.join(ans))


import sys
input = sys.stdin.buffer.readline
T = int(input())
for testcase in range(T):
	n = int(input())
	s = list(input())
	res = []
	for i in range(n):
		if s[i * 2] == 49:
			res.append('1')
		else:
			res.append('0')
	print(''.join(res))


t = int(input())
while t > 0:
	n = int(input())
	str1 = input()
	print(str1[::2])
	t -= 1


t = int(input())
answer = []
for i in range(t):
	n = int(input())
	temp = input()
	(s, ss) = ('', [])
	for j in range(2 * n - 1):
		s += temp[j]
	for j in range(n):
		ss.append(s[j:j + n])
	binary = 2 ** n
	while binary < 2 ** (n + 1):
		count = 0
		for j in range(n):
			for x in range(n):
				if bin(binary)[x + 3] == ss[j][x]:
					count += 1
					break
		if count == n:
			answer.append(bin(binary)[3:])
			break
		else:
			binary += 1
for i in answer:
	print(i)


from sys import stdin, stdout

def II():
	return int(stdin.readline())

def SI():
	return stdin.readline()[:-1]

def solveTC():
	n = II()
	s = SI()
	w = [s[i] for i in range(0, 2 * n, 2)]
	w = ''.join(w) + '\n'
	stdout.write(w)
t = II()
for _ in range(t):
	solveTC()


from collections import deque

def main():
	for _ in range(int(input())):
		n = int(input())
		s = list(map(int, input()))
		x = [0] * n
		j = 0
		for i in range(1, 2 * n, 2):
			x[j] = s[i - 1]
			j += 1
		print(*x, sep='')
main()


import sys

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

def check(s, n, v):
	for i in range(n):
		if s[i:i + n].count(v) == 0:
			return False
	return True

def solve():
	n = mint()
	s = minp()
	if check(s, n, '0'):
		print('0' * n)
	else:
		print('1' * n)
for i in range(mint()):
	solve()


def calculateSim(n, s):
	sr = ''
	i = 0
	while i in range(len(s)):
		sr += s[i]
		i += 2
	return sr
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	print(calculateSim(n, s))


while True:
	break
if True:
	for _ in range(int(input())):
		nVal = int(input())
		strVal = input()
		listVal1 = list(strVal)
		while True:
			break
		listVal2 = []
		for i in range(nVal):
			temp = listVal1[i:i + nVal]
			listVal2.append(temp[i])
		print(''.join(listVal2))


import sys
import math
for _ in range(int(input())):
	n = int(input())
	s = input()
	print(s[n - 1] * n)


def calc(n, s):
	res = list()
	for i in range(0, len(s), 2):
		res.append(s[i])
	return ''.join((str(item) for item in res))

def get_ints():
	return [int(n) for n in input().split()]

def get_floats():
	return [float(n) for n in input().split()]

def seq2str(seq):
	return ' '.join((str(item) for item in seq))
a = get_ints()
assert len(a) == 1
t = a[0]
for i in range(t):
	a = get_ints()
	assert len(a) == 1
	n = a[0]
	s = input()
	assert len(s) == 2 * n - 1
	res = calc(n, s)
	print(res)


t = int(input())
r = []
for x in range(t):
	n = int(input())
	s = input()
	s = list(s)
	a = ''
	for x in range(0, len(s), 2):
		a += s[x]
	r.append(a)
for x in r:
	print(x)


for i in range(int(input())):
	n = int(input())
	s = input()
	print(''.join(s[::2]))


for i in range(int(input())):
	l = int(input())
	s = input()
	out = ' '
	for i in s[::2]:
		out += i
	print(out)


for _ in range(int(input())):
	n = int(input())
	a = input()
	(b, c) = ('', 0)
	for i in range(n):
		b += a[c]
		c += 2
	print(b)


tc = int(input())
for t in range(tc):
	n = int(input())
	s = input()
	m = n - 1
	new_str = ''
	for i in range(n):
		new_str += s[m]
	print(new_str)


t = int(input())
for i in range(0, t):
	m = int(input())
	str1 = input()
	str2 = '0'
	y = len(str1)
	for i in range(0, y, 2):
		str2 = str2[0:] + str1[i:i + 1]
	print(str2[1:])


for _ in range(int(input())):
	n = int(input())
	bin_str = input()
	ans = ''
	for i in range(n):
		ans += bin_str[i:i + n][i]
	print(ans)


inp = lambda cast=int: [cast(x) for x in input().split()]
printf = lambda s='', *args, **kwargs: print(str(s).format(*args), flush=True, **kwargs)
(t,) = inp()
for _ in range(t):
	(n,) = inp()
	(A,) = inp(str)
	B = ''
	for i in range(0, len(A), 2):
		B += A[i]
	print(B[:n])


import sys
t = int(sys.stdin.readline().strip())
for _ in range(t):
	n = int(sys.stdin.readline().strip())
	s = sys.stdin.readline().strip()
	(cnt, c, flag) = (0, 0, 0)
	st = []
	w = ''
	if n == 1 and s == '1':
		print(1)
	elif n == 1 and s == '0':
		print(0)
	else:
		(i, j) = (0, n)
		while j <= 2 * n - 1:
			st.append(s[i:j])
			i += 1
			j += 1
			cnt += 1
		for i in range(cnt):
			for j in range(1, cnt):
				if st[0][i] == st[j][i]:
					c += 1
			if c == cnt - 1:
				pos = i
				flag = 1
				elem = st[0][i]
				break
			c = 0
		if flag == 0:
			print('0' * n)
		else:
			for i in range(n):
				if i != pos:
					if elem == '1':
						w = w + '0'
					else:
						w = w + '1'
				else:
					w = w + elem
			print(w)


for T in range(int(input())):
	n = int(input())
	s = input()
	print(*[s[i] for i in range(0, len(s), 2)], sep='')


for i in range(0, int(input())):
	a = int(input())
	n = list(input())
	q = len(n)
	j = 0
	while j < q:
		print(n[j], end='')
		j += 2
	print()


for i in range(int(input())):
	n = int(input())
	s = input()
	x = []
	for i in range(n):
		y = s[i:i + n]
		x.append(y[i])
	print(''.join(x))


t = int(input())
for i in range(t):
	n = int(input())
	binary = input()
	resp = ''
	for i in range(len(binary) - n + 1):
		resp += binary[2 * i]
	print(resp)


R = lambda : map(int, input().split())
I = lambda : int(input())
L = lambda : list(R())
pr = lambda x: print(x)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 0 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
sm = lambda x: (x ** 2 + x) // 2
mod = 10 ** 9 + 7
for _ in range(I()):
	n = I()
	l = input()
	s = ''
	i = 0
	while i < len(l):
		s = s + l[i]
		i = i + 2
	print(s)


def xor(a, b):
	return bin(int(a, 2) ^ int(b, 2))[2:]
for t in range(int(input())):
	n = int(input())
	s = list(input())
	x = [s[0]]
	for i in range(n):
		res = xor(''.join(x), ''.join(s[i:n + i][:len(x)]))
		if len(x) == n:
			break
		if res == '0':
			continue
		else:
			x.append(s[i + len(x)])
	print(''.join(x).ljust(n, '0'))


def func(n, s):
	sub = []
	for j in range(n):
		sub.append(s[j:j + n])
	if len(sub) <= 1:
		return s
	else:
		res = sub[0]
		for j in range(1, len(sub)):
			count = 0
			for k in range(n):
				if sub[j][k] == res[k]:
					count += 1
			if count > 0:
				pass
			else:
				res = []
				for x in range(n):
					res.append('0')
				res = ''.join(res)
				break
		return res
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	print(func(n, s))


tests = int(input())
for t in range(tests):
	n = int(input())
	substr = input()
	bit = substr[n - 1]
	res = [bit for _ in range(n)]
	print(''.join(res))


from fractions import gcd
from itertools import combinations, permutations, accumulate, product
from collections import deque, defaultdict, Counter
import decimal
import re
import math
import sys
sys.setrecursionlimit(10000000)
mod = 10 ** 9 + 7
from sys import stdin
readline = stdin.readline

def readInts():
	return list(map(int, readline().split()))

def readTuples():
	return tuple(map(int, readline().split()))

def I():
	return int(readline())
for _ in range(I()):
	n = I()
	s = input()
	ls = len(s)
	midls = ls // 2
	mid = n // 2
	ans = s[midls] * n
	print(''.join(ans))


for _ in range(int(input())):
	n = int(input())
	k = list(input())
	arr = list(map(int, k))
	a = arr[n - 1]
	b = [a] * n
	z = map(str, b)
	string = ''.join(z)
	print(string)


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	st = ''
	c = 0
	for j in range(len(s)):
		st += s[j + c]
		c += 1
		if c + 1 > n:
			break
	print(st)


for c in range(int(input())):
	n = int(input())
	s = input()
	a = []
	l = ''
	for x in range(n):
		a.append(s[x:x + n])
	for i in range(n):
		l += a[i][i]
	print(l)


t = int(input())
for i in range(0, t):
	x = int(input())
	s = str(input())
	a = []
	for i in range(0, len(s) - x + 1):
		a.append(list(s[i:i + x]))
	str1 = ''
	for k in range(0, x):
		xor = 0
		for l in range(0, len(a)):
			xor = xor | int(a[k][l])
		str1 += str(xor)
	print(str1)


x = int(input())
while x > 0:
	n = int(input())
	bin = input()
	print(bin[n - 1] * n)
	x -= 1


for _ in range(int(input())):
	n = int(input())
	main_s = ['0'] * n
	s = input()
	for j in range(n):
		main_s[j] = s[j:j + n][j]
	print(*main_s, sep='')


def solve():
	n = int(input())
	s = input()
	for i in range(2 * n - 1):
		if i % 2 == 0:
			print(s[i], end='')
	print('')
t = int(input())
while t:
	t -= 1
	solve()


from itertools import combinations_with_replacement
t = input()
t = int(t)
while t > 0:
	n = input()
	n = int(n)
	s = input()
	combs = combinations_with_replacement(['0', '1'], n)
	for comb in combs:
		count = 0
		x = ''.join(comb)
		for i in range(n):
			ss = s[i:i + n]
			for j in range(len(ss)):
				if ss[j] == x[j]:
					count += 1
					break
		if count == n:
			print(x)
			break
	t -= 1


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	f = ''
	for i in range(1, n + 1):
		a = s[i - 1:n + i - 1]
		if a[i - 1] == '1':
			f += '1'
		else:
			f += '0'
	print(f)


def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = 0
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = 1
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = mpos(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum
from math import *
for _ in range(int(input())):
	n = int(input())
	s = input()
	a = [int(x) for x in list(s)]
	for i in range(0, 2 * n - 1, 2):
		print(a[i], end='')
	print('')


import math
from collections import Counter, defaultdict
I = lambda : int(input())
M = lambda : map(int, input().split())
LI = lambda : list(map(int, input().split()))
for _ in range(I()):
	n = I()
	s = input()
	print(s[n - 1] * n)


for i in range(int(input())):
	n = int(input())
	string1 = input()
	strm = string1[n - 1:n]
	res = strm * n
	print(res)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	s = input().strip()
	ans = ''
	ans += s[n - 1] * n
	print(ans)


n = int(input())
for i in range(n):
	l = int(input())
	s = input()
	print(s[l - 1] * l)


t = int(input())
for test in range(t):
	n = int(input())
	s = list(input())
	ans = ''
	if s.count('1') > s.count('0'):
		for i in range(n):
			ans += '1'
		print(ans)
	else:
		for i in range(n):
			ans += '0'
		print(ans)


t = int(input())
ans = []
for _ in range(t):
	n = int(input())
	s = input()
	s1 = s[:n]
	for i in range(n - 1):
		for j in range(n):
			tmp = s[i + 1:n + i + 1]
			if tmp[j] == '1' and s1[j] == '0':
				s1 = list(s1)
				s1[j] = '1'
				s1 = ''.join(s1)
	print(s1)


def add(s, i):
	return s[i]
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	l = ''
	i = 0
	k = 0
	j = n
	while i <= n - 1 and j <= 2 * n - 1:
		res = add(s[i:j], k)
		l += res
		i += 1
		j += 1
		k += 1
	print(l)


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
sys.setrecursionlimit(10 ** 6)
from queue import PriorityQueue
from collections import Counter as cc
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
sys.setrecursionlimit(10 ** 6)
from queue import PriorityQueue
from collections import Counter as cc
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
import sys
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
import sys
t = int(input())
for _ in range(t):
	n = int(input())
	s = list(input())
	ans = []
	poin = 0
	for i in range(n):
		z = s[i:i + n]
		if len(z) == n:
			ans.append(z[poin])
			poin += 1
	print(''.join(ans))


t = int(input())
for some_num in range(0, t):
	n = int(input())
	s = input()
	sim_str = ''
	for i in range(0, n):
		sim_str += s[2 * i]
	print(sim_str)


import time, math as mt, bisect as bs, sys
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict
pi = 3.141592653589793

def II():
	return int(stdin.readline())

def IP():
	return map(int, stdin.readline().split())

def L():
	return list(map(int, stdin.readline().split()))

def P(x):
	return stdout.write(str(x) + '\n')

def PI(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

def lcm(a, b):
	return a * b // gcd(a, b)

def gcd(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	if a > b:
		return gcd(a % b, b)
	else:
		return gcd(a, b % a)

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def sieve():
	li = [True] * (2 * 10 ** 5 + 5)
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	prime = []
	for i in range(2 * 10 ** 5 + 5):
		if li[i] == True:
			prime.append(i)
	return prime

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count
mx = 10 ** 7
spf = [mx] * (mx + 1)

def SPF():
	spf[1] = 1
	for i in range(2, mx + 1):
		if spf[i] == mx:
			spf[i] = i
			for j in range(i * i, mx + 1, i):
				if i < spf[j]:
					spf[j] = i
	return

def readTree(n, e):
	adj = [set() for i in range(n + 1)]
	for i in range(e):
		(u1, u2) = IP()
		adj[u1].add(u2)
	return adj
mod = 10 ** 9 + 7

def solve():
	n = II()
	a = input()
	s = ''
	for i in range(0, 2 * n - 1, 2):
		s += a[i]
	P(s)
	return
t = II()
for i in range(t):
	solve()


for i in range(int(input())):
	n = int(input())
	st = input()
	ans = ''
	for i in range(n):
		ns = st[i:i + n]
		ans += ns[0 + i]
	print(ans)


try:
	test = int(input())
	while test != 0:
		n = int(input())
		binary = input()
		if n == 1:
			print(binary)
		else:
			string = ''
			for i in range(len(binary) - n + 1):
				bina = binary[i:n + i]
				string = string + bina[i]
			print(string)
		test -= 1
except EOFError as e:
	print('')


for _ in range(int(input())):
	n = int(input())
	st = input()
	ans = ''
	for i in range(0, 2 * n - 1, 2):
		ans += st[i]
	print(ans)


import sys, math
from heapq import *
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	s = [char for char in sys.stdin.readline()]
	print(n * s[n - 1])


for _ in range(int(input())):
	n = int(input())
	S = input()
	D = dict()
	for _ in range(n):
		if S[_] in D:
			D[S[_]] += 1
		else:
			D[S[_]] = 1
	if '1' in D and '0' in D:
		for _ in range(n, len(S)):
			if S[_] in D:
				D[S[_]] += 1
			else:
				D[S[_]] = 1
			if D[S[_ - n]] == 1:
				D.pop(S[_ - n])
			else:
				D[S[_ - n]] -= 1
			if not ('1' in D and '0' in D):
				if '0' in D:
					print('0' * n)
				else:
					print('1' * n)
				break
		else:
			print('0' * n)
	elif '0' in D:
		print('0' * n)
	else:
		print('1' * n)


t = int(input())
ans = []
for _ in range(t):
	arr = []
	n = int(input())
	number = input()
	x = ''
	for i in range(0, n):
		a = number[i:i + n]
		y = list(a)
		x = x + y[i]
	ans.append(x)
for i in ans:
	print(i)


Q = int(input())
ans = []
for i in range(Q):
	N = int(input())
	S = list(input())
	tmpans = []
	for i in range(N):
		tmpans.append(S[i + i])
	ans.append(''.join(tmpans))
for i in range(Q):
	print(ans[i])


t = int(input())
for t in range(t):
	n = int(input())
	s = str(input())
	allS = [s[i:n + i] for i in range(n)]
	res = ''
	for i in range(n):
		tot = 0
		for S in allS:
			if S[i] == '1':
				tot += 1
			else:
				tot -= 1
		if tot >= 0:
			res += '1'
		else:
			res += '0'
		for j in range(len(allS) - 1, -1, -1):
			if allS[j][i] == res[i]:
				allS.pop(j)
	print(res)


for _ in range(int(input())):
	input()
	print(input()[0::2])


t = int(input())
for tt in range(t):
	n = int(input())
	s = input()
	w = []
	for i in range(n):
		w.append(s[i + i])
	print(''.join(w))


for _ in range(int(input())):
	n = int(input())
	s = input()
	c = s[n - 1]
	st = n * c
	print(st)


def A(t):
	n = int(input())
	arr = input()
	if n == 1:
		return arr
	else:
		one = arr.count('1')
		zero = n - 1
		if one > zero:
			ans = '1' * n
		else:
			ans = '0' * n
	return ans
t = int(input())
for _ in range(t):
	ans = A(t)
	print(ans)


def solve():
	n = int(input())
	s = input()
	ans = ['?' for i in range(n)]
	for i in range(n):
		ans[i] = s[i + i]
	print(*ans, sep='')
for i in range(int(input())):
	solve()


t = input()
t = int(t)

def solve(n, s):
	n1 = 0
	n0 = 0
	for x in s:
		if x == '1':
			n1 += 1
		else:
			n0 += 1
	if n1 > n0:
		print('1' * n)
	else:
		print('0' * n)
	return
for i in range(t):
	n = input()
	n = int(n)
	s = input()
	solve(n, s)


t = int(input())
ans = []
for i in range(t):
	n = int(input())
	s = input()
	w = ''
	for j in range(0, 2 * n, 2):
		w += s[j]
	ans.append(w)
for i in ans:
	print(i)


for i in range(int(input())):
	a = int(input())
	b = input()
	print(b[a - 1] * a)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	j = 0
	res = ''
	for i in range(n):
		res += s[i + j]
		j += 1
	print(res)


for _ in range(int(input())):
	N = int(input())
	S = input()
	for i in range(N):
		print(S[i * 2], end='')
	print()


for _ in range(int(input())):
	n = int(input())
	s = list(input())
	s = [int(i) for i in s]
	total = 2 * n - 1
	x = []
	ans = []
	for i in range(n):
		x.append(s[i:n + i])
	for i in range(n):
		y = []
		for j in range(n):
			y.append(x[j][i])
		res = all((ele == y[0] for ele in y))
		if res:
			for c in range(n):
				if c == i:
					ans.append(x[0][i])
				else:
					ans.append(0)
			break
	if len(ans) != n:
		if 1 in x[0]:
			for _ in range(n):
				ans.append(1)
		else:
			for _ in range(n):
				ans.append(0)
	for i in ans:
		print(i, end='')
	print()


for _ in range(int(input())):
	inp = int(input())
	y = input()
	l = []
	s = ''
	for x in range(len(y)):
		if x + inp <= len(y):
			l.append(y[x:x + inp])
		else:
			break
	for num in range(len(l)):
		s += l[num][num]
	print(s)


import sys
input = sys.stdin.readline
t = int(input())
for tests in range(t):
	n = int(input())
	S = input().strip()
	if S[n - 1] == '0':
		print('0' * n)
	else:
		print('1' * n)


from sys import stdin
ip = stdin.readline
for _ in range(int(ip())):
	n = int(ip())
	s = ip().strip()
	print(s[n - 1] * n)


for _ in range(int(input())):
	n = int(input())
	s = input()
	print(s[(2 * n - 1) // 2] * n)


import os
from math import ceil
import sys
from io import BytesIO, IOBase
import sys, bisect, copyreg, copy, statistics, os

def inp():
	return sys.stdin.readline().strip()

def IIX():
	return (int(x) for x in sys.stdin.readline().split())

def II():
	return int(inp())

def LI():
	return list(map(int, inp().split()))

def LS():
	return list(map(str, inp().split()))

def L(x):
	return list(x)

def out(var):
	return sys.stdout.write(str(var))

def solve():
	n = II()
	s = inp()
	count_1 = 0
	count_0 = 0
	for x in s:
		if x == '1':
			count_1 += 1
		else:
			count_0 += 1
	m = max(count_0, count_1)
	if m == count_1:
		out('1' * n)
		out('\n')
	else:
		out('0' * n)
		out('\n')
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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
try:
	t = II()
	for _ in range(t):
		solve()
except EOFError as e:
	out('')


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	s1 = list(s[0:n])
	for i in range(1, len(s) - n + 1):
		flag = True
		for j in range(i, i + n):
			if s1[j - i] == s[j]:
				flag = False
				break
		if flag == True:
			if s1[0] == '0':
				s1[0] = '1'
			else:
				s1[0] = '0'
	print(''.join(s1))
	t -= 1


from sys import stdin, stdout, setrecursionlimit
from math import gcd, ceil, sqrt
from collections import Counter, deque
from bisect import bisect_left, bisect_right
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
setrecursionlimit(100000)
mod = 1000000007

def check(a, b):
	ans = ''
	for (i, j) in zip(a, b):
		if i == j:
			ans += i
		elif i != j:
			ans += 'x'
	return ans
tc = ii1()
for _ in range(tc):
	n = ii1()
	s = is1()
	arr = []
	for i in range(n, 2 * n):
		arr.append(s[i - n:i])
	res = arr[0]
	for i in range(1, len(arr)):
		res = check(res, arr[i])
	res = res.replace('x', '1')
	print(res)


tc = int(input())
for i in range(tc):
	n = int(input())
	string = list(input())
	string = list(map(int, string))
	strings = []
	for i in range(n):
		strings.append(string[i:n + i])
	common = [0] * 1000
	for i in range(1, len(strings)):
		for j in range(len(strings[i])):
			strings[0][j] = strings[0][j] and strings[i][j] == strings[0][j]
	for i in range(len(strings[0])):
		if strings[0][i]:
			print(1, end='')
		else:
			print(0, end='')
	print()


for _ in range(int(input())):
	n = int(input())
	s = input()
	szero = '0' * n
	f = 0
	for i in range(n):
		if s[i:i + n] == szero:
			f = 1
	if f == 1:
		print(szero)
	else:
		print('1' * n)


for koi in range(int(input())):
	a = int(input())
	b = input()
	k = b.count('0')
	l = b.count('1')
	flag = 0
	if k > l:
		flag = 1
	if flag:
		print('0' * a)
	else:
		print('1' * a)


import sys
from collections import defaultdict as dd
from collections import Counter as ccd
from itertools import permutations as pp
from itertools import combinations as cc
from random import randint as rd
from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq as hq
import math
mod = pow(10, 9) + 7

def inp(flag=0):
	if flag == 0:
		return input().strip()
	elif flag == 1:
		return int(input())
	else:
		return list(map(int, input().strip().split(' ')))

def inp_fast(flag=0):
	if flag == 0:
		return sys.stdin.readline()
	elif flag == 1:
		return int(sys.stdin.readline())
	else:
		return list(map(int, sys.stdin.readline().split()))
t = inp(1)
while t:
	t -= 1
	n = inp(1)
	s = inp()
	ans = ''
	for i in range(0, 2 * n - 1, 2):
		ans += s[i]
	print(ans)


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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math
from collections import Counter, defaultdict, deque

def int1():
	return int(input())

def map1():
	return map(int, input().split())

def list1():
	return list(map(int, input().split()))
mod = pow(10, 9) + 7

def solve():
	n = int(input())
	s = input()
	s1 = ''
	for i in range(n):
		x = 2 * (i + 1) - 2
		s1 += s[x]
	print(s1)
for _ in range(int(input())):
	solve()


T = int(input())
for _ in range(T):
	n = int(input())
	s = input()
	ans = ''
	p = 0
	for i in range(n):
		ans += s[p]
		p += 2
	print(ans)


from sys import stdin
tt = int(stdin.readline())
for loop in range(tt):
	n = int(stdin.readline())
	s = stdin.readline()
	s = s[:-1]
	print(s[n - 1] * n)


for i in range(int(input())):
	n = int(input())
	s = input()
	lst = list()
	for i in range(len(s)):
		if i % 2 == 0:
			lst.append(s[i])
	print(*lst, sep='')


test = int(input())
for t in range(test):
	n = int(input())
	st = input()
	s = ''
	for i in range(n):
		s = s + st[n - 1]
	print(s)


def out(s, n):
	if s.count('1') > s.count('0'):
		return '1' * n
	else:
		return '0' * n
t = int(input())
while t:
	n = int(input())
	s = input()
	ans = str(out(s, n))
	print(ans)
	t -= 1


t = int(input())
out = []
for T in range(t):
	n = int(input())
	s = input()
	w = ''
	if n == 1:
		w = s
	else:
		for i in range(n):
			a = s[i:n + i]
			w = w + a[i]
	out.append(w)
for i in out:
	print(i)


t = int(input())
for j in range(t):
	n = int(input())
	list1 = list(input())
	stri = ['0'] * n
	for i in range(n):
		for j in range(i, n):
			stri[i] = list1[j]
	print(''.join(stri))


for _ in range(int(input())):
	n = int(input())
	s = input()
	i = 0
	w = ''
	while i + (n - 1) < len(s):
		a = s[i:]
		w = w + a[i]
		i += 1
	print(w)


for _ in range(int(input())):
	n = int(input())
	a = input()
	if a[n - 1] == '0':
		b = '0' * n
	else:
		b = '1' * n
	print(b)


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	if n == 1 and s[0] == 0:
		print(0)
	elif n == 1 and s[0] == 1:
		print(1)
	else:
		val = s[n - 1]
		m = [val] * n
		m = ''.join(map(str, m))
		print(m)


for i in range(int(input())):
	n = int(input())
	print(input()[0::2])


t = int(input())
for l in range(0, t):
	n = int(input())
	s = input()
	b = []
	i = 0
	while i < 2 * n - 1:
		b.append(s[i])
		i = i + 2
	st = ''
	st = ''.join(b)
	print(st)


for _ in range(int(input())):
	N = int(input())
	S = input()
	w = ''
	for i in range(N):
		w += S[i * 2]
	print(w)


def incrementaResp(s, n):
	for i in range(n - 1, -1, -1):
		if s[i] == '0':
			s[i] = '1'
			break
		else:
			s[i] = '0'
t = int(input())
for testCase in range(t):
	n = int(input())
	s1 = input()
	s2 = ['0'] * (2 * n - 1)
	for i in range(len(s1)):
		if s1[i] == '0':
			s2[i] = '1'
	resp = ['0'] * n
	while True:
		if ''.join(resp) in ''.join(s2):
			incrementaResp(resp, n)
		else:
			break
	for e in resp:
		print(e, end='')
	print()


for i in range(int(input())):
	n = int(input())
	s = input()
	p = s[n - 1]
	print(p * n)


t = int(input())
res = []
q = 0
while q < t:
	n = int(input())
	similar = ['0'] * n
	string = list(input())
	i = 1
	while i <= n:
		similar[n - i] = string[n - 1]
		i += 1
	res.append(similar)
	q += 1
for e in res:
	print(''.join(e))


from sys import stdin, stdout
from collections import Counter
from collections import defaultdict
from math import ceil
from bisect import bisect_left
from bisect import bisect_right
import math
ai = lambda : list(map(int, stdin.readline().split()))
ei = lambda : map(int, stdin.readline().split())
ip = lambda : int(stdin.readline().strip())
for i in range(ip()):
	n = ip()
	test_str = input()
	K = n
	ans = ''
	res = [test_str[i:j] for i in range(len(test_str)) for j in range(i + 1, len(test_str) + 1) if len(test_str[i:j]) == K]
	for i in range(n):
		ans += res[i][i]
	print(ans)


import sys
input = sys.stdin.readline
from collections import deque
from queue import LifoQueue
for _ in range(int(input())):
	n = int(input())
	s = input()
	a = ''
	for i in range(0, 2 * n, 2):
		a += str(s[i])
	print(a)


T = int(input())
for t in range(1, T + 1):
	N = int(input())
	str = input()
	answer = ''
	j = 0
	for i in range(N):
		answer += str[i:i + N][i]
	print(answer)


testCases = int(input())
for i in range(testCases):
	n = int(input())
	string = input()
	print(string[:len(string) + 1:2])


for _ in range(int(input())):
	n = int(input())
	s = input()
	j = s[n - 1]
	print(j * n)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	out = ''
	for i in range(len(s)):
		if i % 2 == 0:
			out += s[i]
	print(out)


t = int(input())
for l in range(0, t):
	k = int(input())
	p = input()
	print(p[0::2])


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	c0 = 0
	c1 = 0
	for i in s:
		if i == '0':
			c0 += 1
		else:
			c1 += 1
	if c0 > c1:
		ans = '0' * n
	else:
		ans = '1' * n
	print(ans)
	t -= 1


n = int(input())
l = []
temp = []
for i in range(n):
	k = int(input())
	lst = input()
	temp = [lst[i] for i in range(len(lst)) if i % 2 == 0]
	l.append(temp)
for i in range(len(l)):
	for j in range(len(l[i])):
		print(l[i][j], end='')
	print('')


def main():
	t = int(input())
	for case in range(t):
		n = int(input())
		s = input()
		res = ''
		i = 0
		while i < len(s):
			res += s[i]
			i += 2
		print(res)
main()


t = int(input())
while t:
	t -= 1
	n = int(input())
	s = input()
	a = s[n - 1]
	ans = a * n
	print(ans)


for _ in range(int(input())):
	n = int(input())
	li = list(input())
	l = len(li)
	c = li[l // 2]
	print(str(c) * n)


for t in range(int(input())):
	N = int(input())
	S = input()
	m = ''
	for n in range(N):
		m += S[n:n + N][n]
	print(m)


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = input()
		b = [0] * n
		for i in range(1, n + 1):
			b[i - 1] = a[i - 1 + i - 1]
		print(''.join(b))
main()


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	res = s[n - 1] * n
	print(res)


l = []
for _ in range(int(input())):
	n = int(input())
	a = list(input())
	s = str()
	for i in range(n):
		s = s + a[i + i]
	l.append(s)
for i in l:
	print(i)


import math
T = int(input())
for t in range(T):
	n = int(input())
	a = input()
	d = False
	print(a[n - 1] * n)


for _ in range(int(input())):
	n = int(input())
	s = str(input())
	r = ''
	for i in range(n):
		rs = s[i:n + i]
		r = r + rs[i]
	print(r)


t = int(input())
n = []
s = []
for i in range(0, t):
	x = int(input())
	n.append(x)
	l = input()
	s.append(l)
r = []
for i in range(0, t):
	sim = ''
	y = s[i]
	for j in range(len(y)):
		if j % 2 == 0:
			sim = sim + y[j]
	r.append(sim)
for i in range(0, t):
	print(r[i])


for _ in range(int(input())):
	n = int(input())
	s = input().strip()
	l = []
	for i in range(0, 2 * n - 1, 2):
		l.append(s[i])
	print(''.join([i for i in l]))


def do():
	q = int(input())
	for _ in range(q):
		n = int(input())
		s = input()
		res = ''
		for i in range(n):
			res += s[2 * i]
		print(res)
do()


t = int(input())
while t:
	n = int(input())
	s = input()
	s1 = ''
	for i in range(n):
		x = s[i:i + n]
		s1 += x[i]
	print(s1)
	t -= 1


for _ in range(int(input())):
	n = int(input())
	a = input()
	ans = str()
	for i in range(n):
		ans += a[2 * i]
	print(ans)


import math
import sys, collections
from sys import stdin, stdout

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()

def input():
	return sys.stdin.readline().strip()

def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w')

def is_subsequence(x, y):
	x = list(x)
	for letter in y:
		if x and x[0] == letter:
			x.pop(0)
	return not x

def sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, mt.ceil(mt.sqrt(MAXN))):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def getFactorization(x):
	ret = list()
	while x != 1:
		ret.append(spf[x])
		x = x // spf[x]
	return ret

def getFloor(A, x):
	(left, right) = (0, len(A) - 1)
	(ind, floor) = (-1, -1)
	while left <= right:
		mid = (left + right) // 2
		if x < A[mid]:
			right = mid - 1
		else:
			floor = A[mid]
			ind = mid
			left = mid + 1
	return ind

def check(st):
	n = len(st)
	digitSum = 0
	for i in range(0, n):
		digitSum = digitSum + int(st[i])
	return digitSum % 9 == 0

def isPowerOfTwo(n):
	if n == 0:
		return False
	while n != 1:
		if n % 2 != 0:
			return False
		n = n // 2
	return True

def kitte(n):
	c = 0
	while n != 0:
		n = n // 2
		c += 1
	return c

def haha(n):
	c = 1
	for i in range(n):
		if c > n:
			break
		else:
			c *= 2
	return c // 2
mod = 10 ** 9 + 7

def main():
	for tt in range(int(input())):
		n = int(input())
		l = input()
		(z, o) = (0, 0)
		for i in range(n):
			s = l[i:n + i]
			if '0' in s:
				z += 1
			if '1' in s:
				o += 1
		if z > o:
			print('0' * n)
		else:
			print('1' * n)
main()


def getIntArray():
	a = input().split()
	a = [int(x) for x in a]
	return a

def solve():
	n = int(input())
	k = n
	s = input()
	start = 0
	ans = list(s[start:n])
	start += 1
	n += 1
	while n <= len(s):
		t = s[start:n]
		for i in range(k):
			if ans[i] == t[i]:
				ans[i] = t[i]
			else:
				ans[i] = '0'
		start += 1
		n += 1
	print(''.join(ans))
t = int(input())
while t:
	solve()
	t -= 1


for _ in range(int(input())):
	n = int(input())
	s = input()
	ss = [i for i in s]
	zero = ss.count('0')
	one = ss.count('1')
	if zero > one:
		print(n * '0')
	else:
		print(n * '1')


x = int(input())
for i in range(x):
	r = int(input())
	s = input()
	dum = 0
	ans = [s[r - 1]] * r
	print(''.join(ans))


def ans():
	N = int(input())
	for i in range(N):
		a = int(input())
		b = input()
		c = []
		d = 2 * a
		for j in range(0, d - 1, 2):
			c += [b[j]]
		c = ''.join(c)
		print(c)
ans()


t = int(input())
for i in range(t):
	n = int(input())
	p = input()
	for j in range(0, 2 * n, 2):
		print(p[j], end='')
	print()


t = int(input())
k = [0] * t
for i in range(t):
	n = int(input())
	string = input()
	stri = list(string)
	ls = [0] * (2 * n - 1)
	for j in range(len(stri)):
		if j % 2 == 0:
			ls[j] = stri[j]
		else:
			ls[j] = ''
	k[i] = ''.join(ls)
for i in range(t):
	print(k[i])


for _ in range(int(input())):
	n = int(input())
	s = input()
	q = ''
	for i in range(n):
		q += s[i * 2]
	print(q)


for _ in range(int(input())):
	x1 = int(input())
	x = input()
	t = ''
	s = ''
	if x.count('1') > x.count('0'):
		s = '1'
	if x.count('0') > x.count('1'):
		s = '0'
	while x1 != 0:
		t += s
		x1 -= 1
	print(t)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	r = s[n - 1] * n
	print(r)


def solve():
	n = int(input())
	s = input()
	arr = ''
	k = 0
	for i in range(n):
		a = s[i:i + n]
		arr += a[k]
		k += 1
	return arr
t = int(input())
for i in range(t):
	print(solve())


for _ in range(int(input())):
	n = int(input())
	s = str(input())
	out = ''
	for i in range(0, len(s), 2):
		out += s[i]
	print(out[:n])


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	array1 = [1 for i in range(n)]
	for i in range(n):
		array2 = [int(i) for i in list(s[i:i + n])]
		array1 = list(map(lambda x, y: x * y, array1, array2))
	l3 = [str(i) for i in array1]
	print(''.join(l3))


t = int(input())
for ite in range(t):
	n = int(input())
	s = input()
	print(*[s[2 * i] for i in range(n)], sep='')


import sys
read = sys.stdin.readline
write = sys.stdout.write
for t in range(int(read())):
	n = int(read())
	s = read().strip()
	fill = '0'
	for i in range(n):
		if '0' in s[i:i + n]:
			continue
		fill = '1'
		break
	write('{}\n'.format(fill * n))


def solve(s, n, ans):
	index = 0
	s1 = []
	while index < 2 * n - 1:
		s1.append(s[index])
		index += 2
	ans.append(''.join(s1))

def main():
	t = int(input())
	ans = []
	for i in range(t):
		n = int(input())
		s = input()
		solve(s, n, ans)
	print('\n'.join(ans))
main()


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	z = list()
	z = list(map(str, s))
	y = list()
	x = list()
	index = 0
	for i in range(n):
		y.append(z[i:n + i])
		x.append(y[i][i])
	print(''.join(x))
	t = t - 1


def solve(s, n):
	if n == 1 and s[0] == '1':
		return '1'
	elif n == 0 and s[0] == '0':
		return '0'
	ans = []
	zc = 0
	oc = 0
	for i in range(len(s)):
		if s[i] == '1':
			oc += 1
		else:
			zc += 1
	if zc > oc:
		ans = ['0'] * n
	else:
		ans = ['1'] * n
	return ''.join(ans)
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	print(solve(s, n))


import sys
import math
import heapq
import collections
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')

def printspace(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer(' ')

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]

def inputstringnum():
	return [ord(x) - ord('a') for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	n = inputnum()
	s = inputstring()
	rtn = s[n - 1] * n
	print(rtn)


def rn():
	a = int(input())
	return a

def rl():
	a = list(map(int, input().split()))
	return a
for _ in range(rn()):
	n = rn()
	a = input()
	ans = ''
	for i in range(0, 2 * n - 1, 2):
		ans = ans + a[i]
	print(ans)


from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	s = input()
	start = 0
	end = n - 1
	freq = defaultdict(int)
	for i in range(n):
		freq[s[i]] += 1
	while end < 2 * n - 2 and freq['0'] and freq['1']:
		freq[s[start]] -= 1
		start += 1
		end += 1
		freq[s[end]] += 1
	if freq['0']:
		ans = '0' * n
	else:
		ans = '1' * n
	print(ans)


T = int(input())
while T:
	T -= 1
	n = int(input())
	s = input()
	x = s[n - 1]
	print(x * n)


query = int(input())
for i in range(query):
	size = int(input())
	arr = input()
	length = len(arr)
	count = 0
	new_str = ''
	for j in range(0, length, 2):
		new_str = new_str + arr[j]
	print(new_str)


for _ in range(int(input())):
	n = int(input())
	a = input()
	if n == 1:
		print(a)
	else:
		print(a[(2 * n - 1) // 2] * n)


t = int(input())
for _ in range(t):
	n = int(input())
	s = list(input())
	if s.count('1') >= n:
		print('1' * n)
	else:
		print('0' * n)


import sys, collections, math

def in_out():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
for _ in range(int(input())):
	n = int(input())
	s = input()
	val = s[n - 1]
	st = s[n - 1] * n
	print(st)


t = int(input())
for i in range(t):
	a = []
	n = int(input())
	s = ['zero'] + list(input())
	for j in range(1, len(s), 2):
		a.append(s[j])
	for j in a:
		print(int(j), end='')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	z = str()
	for i in range(0, 2 * n, 2):
		z = z + s[i]
	print(z)


import sys

def rl(int_: bool=True):
	if int_:
		return [int(w) for w in sys.stdin.readline().split()]
	return [w for w in sys.stdin.readline().split()]
for _ in range(rl()[0]):
	(n,) = rl()
	(s,) = rl(False)
	res = []
	for i in range(n):
		res.append(s[2 * i])
	print(''.join(res))


def main():
	tc = int(input().strip())
	for i in range(tc):
		n = int(input().strip())
		s = input()
		print(s[n - 1] * n)
main()


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	w = ''
	c = 0
	if n == 1:
		print(s)
		continue
	for j in range(n):
		w += s[j:][c]
		c += 1
	print(w)


t = int(input())
for i in range(t):
	n = int(input())
	a = input()
	com = a[n - 1]
	b = ''
	for i in range(n):
		b += com
	print(b)


t = int(input())
for z in range(t):
	n = int(input())
	s = input()
	w = [0 for i in range(n)]
	for i in range(n):
		w[i] = s[2 * i]
	for i in range(n):
		print(w[i], end='')
	print('')


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 998244353
EPS = 1e-06

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	n = Int()
	s = input()
	ans = []
	for i in range(0, 2 * n, 2):
		ans.append(s[i])
	print(*ans, sep='')


import sys
import math

def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()

def p(f):
	print('Yes' if f else 'No')

def solve():
	n = II()
	s = SI()
	w = ''
	for i in range(0, 2 * n - 1, 2):
		w += s[i]
	print(w)
tests = 1
t = 1
if tests:
	t = II()
for q in range(t):
	solve()


for _ in range(int(input())):
	n = int(input())
	s = input()
	(res, i) = ('', 0)
	for idx in range(0, len(s) - n + 1):
		s2 = s[idx:idx + n]
		res += s2[i]
		i += 1
	print(res)


t = int(input())
ls = []
for z in range(t):
	n = int(input())
	a = input()
	temp = a[n - 1]
	st = temp * n
	ls.append(st)
for i in ls:
	print(i)


for t in range(int(input())):
	n = int(input())
	s = input()
	s1 = ''
	a = s.count('1')
	b = s.count('0')
	if a > b:
		s1 += '1' * n
	else:
		s1 += '0' * n
	print(s1)


for _ in range(int(input())):
	n = int(input())
	string = input()
	print(string[0::2])


t = int(input())
for i in range(t):
	n = int(input())
	s = list(input())
	result = ''
	for j in range(len(s) - n + 1):
		r = s[j:j + n]
		result += r[j]
	print(result)


def fn(s, n):
	ans = int('1' * n, 2)
	for i in range(n):
		ans &= int(''.join(s[i:i + n]), 2)
	return bin(ans)[2:].zfill(n)
for _ in range(int(input())):
	n = int(input())
	s = input()
	print(fn(s, n))


test = int(input())
for i in range(test):
	n = int(input())
	s = input()
	a = s[n - 1] * n
	print(a)


t = int(input())
for i in range(t):
	l = int(input())
	s = input()
	n = len(s)
	c = s[l - 1]
	ans = ''
	for j in range(l):
		ans = ans + c
	print(ans)


def solution(s, n):
	out = ''
	i = 0
	while i < 2 * n - 1:
		out += s[i]
		i += 2
	return out
for _ in range(int(input())):
	n = int(input())
	s = input()
	print(solution(s, n))


for T in range(int(input())):
	n = int(input())
	s = list(str(input()))
	w = s[n - 1]
	print(str(w) * n)


for _ in range(int(input())):
	n = int(input())
	s = input()
	l = []
	for i in range(n):
		l.append(s[2 * i])
	ans = ''.join(l)
	print(ans)


for _ in range(int(input())):
	n = int(input())
	s = input()
	print('{}'.format(s[n - 1]) * n)


import sys
input = sys.stdin.readline

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0, hi=None):
	if hi == None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from itertools import permutations
import math
from bisect import bisect_left

def solve():
	n = int(input())
	s = input()
	print(s[n - 1] * n)
for _ in range(int(input())):
	solve()


for i in range(int(input())):
	n = int(input())
	s = input()
	ans = s[::+2]
	print(ans)


for _ in range(int(input())):
	ans = ''
	n = int(input())
	s = input()
	for i in range(n):
		q = s[i:i + n]
		ans += q[i]
	print(ans)


t = int(input())
n = []
s = []
for i in range(t):
	a = int(input())
	n.append(a)
	b = input().split()
	s.append(b)
samp = []
for j in range(t):
	for k in range(n[j]):
		z = ''
		for l in range(k, n[j] + k):
			z = str(z) + s[j][0][l]
		samp.append(z)
kk = 0
for ii in range(t):
	for jj in range(n[ii]):
		print(samp[kk][jj], end='')
		kk = kk + 1
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	inp = input()
	A = list(map(int, inp))
	flag = 0
	s = ''
	temp = A[n - 1]
	for i in range(n):
		s = s + str(temp)
	print(s)


from sys import stdin, stdout, setrecursionlimit
from math import gcd, ceil, sqrt
from collections import Counter, deque
from bisect import bisect_left, bisect_right
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
setrecursionlimit(100000)
mod = 1000000007
tc = ii1()
for _ in range(tc):
	n = ii1()
	s = is1()
	print(s[n - 1] * n)


for t in range(int(input())):
	n = int(input())
	s = list(input())
	l = []
	for i in range(0, 2 * n, 2):
		l.append(s[i])
	print(''.join(l))


t = int(input())
for i in range(t):
	n = int(input())
	s = list(input())
	s1 = []
	for j in range(len(s)):
		if j % 2 == 0:
			s1.append(s[j])
	print(''.join(s1))


import sys, bisect
from sys import stdin, stdout
from bisect import bisect_left, bisect_right, bisect, insort, insort_left, insort_right
from math import gcd, ceil, floor, sqrt
from collections import Counter, defaultdict, deque, OrderedDict
from queue import Queue, PriorityQueue
from string import ascii_lowercase
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 998244353
mod = 10 ** 9 + 7

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	for i in range(5, ceil(sqrt(n)) + 1, 6):
		if n % i == 0 or n % (i + 2) == 0:
			return False
	return True

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

def li():
	return list(map(int, stdin.readline().split()))

def mp():
	return map(int, stdin.readline().split())

def pr(n):
	stdout.write(str(n) + '\n')

def DFS(dictionary, vertex, visited):
	visited[vertex] = True
	stack = [vertex]
	print(vertex)
	while stack:
		a = stack.pop()
		for i in dictionary[a]:
			if not visited[i]:
				print(i)
				visited[i] = True
				stack.append(i)

def BFS(dictionary, vertex, visited):
	visited[vertex] = True
	q = deque()
	q.append(vertex)
	while q:
		a = q.popleft()
		for i in dictionary[a]:
			if not visited[i]:
				visited[i] = True
				q.append(i)
				print(i)

def soe(limit):
	l = [1] * (limit + 1)
	l[0] = 0
	l[1] = 0
	prime = []
	for i in range(2, limit + 1):
		if l[i]:
			for j in range(i * i, limit + 1, i):
				l[j] = 0
	for i in range(2, limit + 1):
		if l[i]:
			prime.append(i)
	return prime

def segsoe(low, high):
	limit = int(high ** 0.5) + 1
	prime = soe(limit)
	n = high - low + 1
	l = [0] * (n + 1)
	for i in range(len(prime)):
		lowlimit = low // prime[i] * prime[i]
		if lowlimit < low:
			lowlimit += prime[i]
		if lowlimit == prime[i]:
			lowlimit += prime[i]
		for j in range(lowlimit, high + 1, prime[i]):
			l[j - low] = 1
	for i in range(low, high + 1):
		if not l[i - low]:
			if i != 1:
				print(i)

def gcd(a, b):
	while b:
		a = a % b
		(b, a) = (a, b)
	return a

def power(a, n):
	r = 1
	while n:
		if n & 1:
			r = r * a
		a *= a
		n = n >> 1
	return r

def solve():
	n = inp()
	s = st()
	for i in range(n):
		a = s[i:i + n]
		z = a.count('1')
		y = a.count('0')
		if z == 0:
			pr('0' * n)
			return
		if y == 0:
			pr('1' * n)
			return
	pr('0' * n)
for _ in range(inp()):
	solve()


t = int(input())
for o in range(t):
	n = int(input())
	a = list(map(int, input()))
	ans = []
	i = 0
	while i < 2 * n - 1:
		ans.append(a[i])
		i += 2
	print(*ans, sep='')


import math
t = int(input())
a = []
b = []
for i in range(t):
	o = int(input())
	h = list(map(int, input()))
	b.append(h)
	a.append(o)

def tully(n, arr):
	k = []
	for i in range(2 * n - 1):
		if i % 2 == 0:
			k.append(arr[i])
	return k
for i in range(t):
	y = tully(a[i], b[i])
	for j in range(len(y)):
		if j != len(y) - 1:
			print(y[j], end='')
		else:
			print(y[j])


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		s = input()
		w = ''
		for i in range(n):
			w += s[i * 2]
		print(w)
main()


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase

def main():

	def solve():
		n = int(input())
		string = input()
		section = int(string[:n], 2)
		w = section
		for i in range(1, n):
			section &= ~(1 << n - 1)
			section <<= 1
			section |= int(string[i + n - 1])
			w &= section
		binary = bin(w)[2:]
		if len(binary) == n:
			print(binary)
		else:
			print('0' * (n - len(binary)) + binary)
	t = int(input())
	for i in range(t):
		solve()
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')
input = lambda : sys.stdin.readline().rstrip('\r\n')

def print(*args, **kwargs):
	sep = kwargs.pop('sep', ' ')
	file = kwargs.pop('file', sys.stdout)
	atStart = True
	for x in args:
		if not atStart:
			file.write(sep)
		file.write(str(x))
		atStart = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
main()


T = int(input())
for t in range(T):
	n = int(input())
	s = input()
	print(s[n - 1] * n)


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	ch = s[n - 1]
	print(ch * n)


import math
import sys

class Read:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(sep=' '):
		return input().split(sep)

	@staticmethod
	def list_int(sep=' '):
		return list(map(int, input().split(sep)))

def solve():
	n = Read.int()
	s = Read.string()
	res = ''
	idx = 0
	for i in range(n):
		res = res + s[idx]
		idx = idx + 2
	print(res)
query_count = Read.int()
while query_count:
	query_count -= 1
	solve()


t = int(input())
while t:
	n = int(input())
	inp = str(input())
	print(inp[::2])
	t -= 1


T = int(input())
for _ in range(T):
	N = int(input())
	S = input()
	print(S[N - 1] * N)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
from itertools import permutations, combinations
mod = int(1000000000.0) + 7
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
t = ip()
for _ in range(t):
	n = ip()
	s = ips()
	ct = 0
	l = len(s)
	ans = []
	for i in range(l - n + 1):
		temp = s[i:i + n]
		ans.append(temp[ct])
		ct += 1
	ans = ''.join(ans)
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	s2 = ''
	for i in range(len(s)):
		if i % 2 == 0:
			s2 += s[i]
	print(s2)


for i in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	for j in range(0, len(s), 2):
		ans += s[j]
	print(ans)


t = int(input())
sol = []
for i in range(t):
	n = int(input())
	s = input()
	s = list(s)
	l = ''
	for j in range(n):
		l += s[2 * j]
	sol.append(l)
for i in sol:
	print(i)


def sim(n, seq):
	ans = ''
	for i in range(len(seq)):
		if i % 2 == 0:
			ans += seq[i]
	return ans
n = int(input())
res = []
for i in range(n):
	p = int(input())
	a = str(input())
	res.append(sim(p, a))
for j in res:
	print(j)


for _ in range(int(input())):
	n = int(input())
	s = input()
	l = []
	c = 0
	for i in range(0, len(s) - n + 1):
		l.append(s[i + c])
		c += 1
	print(''.join(l))


dx = [0, 0, -1, 1]
dy = [1, -1, 0, 0]

def solve(n, s):
	ans = []
	cnt = 0
	for i in range(n):
		ans.append(s[i + cnt])
		cnt += 1
	print(''.join(map(str, ans)))
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	solve(n, s)


import sys, math
import io, os
from collections import defaultdict as dd, deque, Counter

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
from decimal import Decimal
INF = float('inf')
mod = int(1000000000.0) + 7
for t in range(int(data())):
	n = int(data())
	s = data()
	out(s[n - 1] * n)


t = int(input())
for i in range(t):
	n = int(input())
	strn = input()
	newstr = ''
	for i in range(0, 2 * n - 1, 2):
		newstr += strn[i]
	print(newstr)


n = int(input())
for i in range(n):
	a = int(input())
	in_ = input()
	binar = []
	for j in range(a):
		binar.append(int(in_[a - 1]))
	for k in range(a):
		print(binar[k], end='')
	print(end='\n')


for k in range(int(input(''))):
	n = int(input(''))
	s = input('')
	i = 0
	j = n
	l = []
	w = ''
	while j <= len(s):
		l.append(s[i:j])
		i += 1
		j += 1
	for i in range(len(l)):
		w += l[i][i]
	print(w)


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	k = ''
	j = 0
	r = 0
	while j < n:
		k += s[j + r]
		j += 1
		r += 1
	print(k)


from sys import stdin

def inp():
	return stdin.buffer.readline().rstrip().decode('utf8')

def itg():
	return int(stdin.buffer.readline())

def mpint():
	return map(int, stdin.buffer.readline().split())
for __ in range(itg()):
	n = itg()
	s = inp()
	print(s[len(s) >> 1] * n)


for _ in range(int(input())):
	n = int(input())
	s = [i for i in input()]
	result = ''
	for i in range(n):
		result += s[i * 2]
	print(result)


import sys
from math import sqrt
from collections import defaultdict
inpt = sys.stdin.readline

def inp():
	return int(inpt())

def inlist():
	return list(map(int, inpt().split()))

def instr():
	s = inpt()
	return list(s[:len(s) - 1])

def invr():
	return map(int, inpt().split())

class Graph:

	def __init__(self, n):
		self.n = n
		self.graph = defaultdict(list)
		self.marked = defaultdict(int)

	def addEdge(self, u, v):
		self.graph[u].append(v)
		self.graph[v].append(u)

	def dfs(self, u):
		self.marked[u] = 1
		for i in self.graph[u]:
			if self.marked[i] == 0:
				self.dfs(i)

def main():
	t = inp()
	for l in range(t):
		n = inp()
		s = instr()
		w = []
		for i in range(0, len(s), 2):
			w.append(s[i])
		for i in range(n):
			print(w[i], end='')
		print()
main()


for _ in range(int(input())):
	n = int(input())
	m = 2 * n - 1
	s = input()
	w = ''
	for i in range(0, m):
		if i % 2 == 0:
			w = w + s[i]
	print(w)


from math import gcd
from bisect import bisect_left, bisect_right
from itertools import combinations
from itertools import permutations
from bisect import bisect_left
from math import ceil
from math import radians
from heapq import heapify, heappush, heappop
import bisect
from math import pi
from collections import deque
from math import factorial
from math import log, ceil
from collections import defaultdict
from math import *
from sys import stdin, stdout
import itertools
import os
import sys
import threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *
from fractions import Fraction
mod = int(pow(10, 9) + 7)

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li1():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d:
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d:
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = defaultdict(list)
	for i in range(n):
		(x, y) = mi()
		d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0 and i % 2 == 1:
			s.add(i)
			n = n // i
	if n > 2 and n % 2 == 1:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)

def SieveOfEratosthenes(n, isPrime):
	isPrime[0] = isPrime[1] = False
	for i in range(2, n):
		isPrime[i] = True
	p = 2
	while p * p <= n:
		if isPrime[p] == True:
			i = p * p
			while i <= n:
				isPrime[i] = False
				i += p
		p += 1
	return isPrime

def dijkstra(edges, f, t):
	g = defaultdict(list)
	for (l, r, c) in edges:
		g[l].append((c, r))
	(q, seen, mins) = ([(0, f, ())], set(), {f: 0})
	while q:
		(cost, v1, path) = heappop(q)
		if v1 not in seen:
			seen.add(v1)
			path = (v1, path)
			if v1 == t:
				return (cost, path)
			for (c, v2) in g.get(v1, ()):
				if v2 in seen:
					continue
				prev = mins.get(v2, None)
				next = cost + c
				if prev is None or next < prev:
					mins[v2] = next
					heappush(q, (next, v2, path))
	return float('inf')

def binsearch(a, l, r, x):
	while l <= r:
		mid = l + (r - 1) // 2
		if a[mid]:
			return mid
		elif a[mid] > x:
			l = mid - 1
		else:
			r = mid + 1
	return -1

def readTree(n):
	adj = [set() for _ in range(n)]
	for _ in range(n - 1):
		(u, v) = map(int, input().split())
		adj[u - 1].add(v - 1)
		adj[v - 1].add(u - 1)
	return adj

def treeOrderByDepth(n, adj, root=0):
	parent = [-2] + [-1] * (n - 1)
	ordered = []
	q = deque()
	q.append(root)
	depth = [0] * n
	while q:
		c = q.popleft()
		ordered.append(c)
		for a in adj[c]:
			if parent[a] == -1:
				parent[a] = c
				depth[a] = depth[c] + 1
				q.append(a)
	return (ordered, parent, depth)

def isSubSequence(str1, str2):
	m = len(str1)
	n = len(str2)
	j = 0
	i = 0
	while j < m and i < n:
		if str1[j] == str2[i]:
			j = j + 1
		i = i + 1
	return j == m

def nextPowerOf2(n):
	count = 0
	if n and (not n & n - 1):
		return n
	while n != 0:
		n >>= 1
		count += 1
	return 1 << count

def cou(n):
	c = 0
	while n > 1:
		c += 1
		n //= 2
	return c

def sortsec(l):
	return sorted(l, key=lambda x: x[1])

def BinarySearch(a, x):
	i = bisect_left(a, x)
	if i:
		return i - 1
	else:
		return -1

def subarray(A):
	r = set()
	p = {0}
	for x in A:
		p = {x | y for y in p} | {x}
		r |= p
	return len(r)
for _ in range(ii()):
	n = ii()
	s = si()
	ans = ''
	for i in range(2 * n - 1):
		if i % 2 == 0:
			ans += s[i]
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	s = str(input())
	a = ''
	if s.count('0') > s.count('1'):
		print(n * '0')
	else:
		print(n * '1')


import sys
input = sys.stdin.readline

def inInt():
	return int(input())

def inStr():
	return input().strip('\n')

def inIList():
	return list(map(int, input().split()))

def inSList():
	return input().split()

def bsearch(nums, target):
	N = len(nums or [])
	l = 0
	r = N - 1
	while l <= r:
		mid = (l + r) // 2
		if nums[mid] < target:
			l = mid + 1
		elif nums[mid] > target:
			r = mid - 1
		else:
			return (None, mid, None)
	return (r if r >= 0 else None, None, l if l <= N - 1 else None)

def yesOrNo(val):
	print('YES' if val else 'NO')

def solve():
	n = inInt()
	s = inStr()
	ans = ''
	for i in range(n):
		sub = s[i:i + n]
		for j in range(len(ans)):
			if sub[j] == ans[j]:
				break
		else:
			ans += sub[len(ans)]
	ans += '0' * (n - len(ans))
	print(ans)
tests = inInt()
for case in range(tests):
	solve()


for _ in range(int(input())):
	n = int(input())
	s = input()
	z = s.count('0')
	o = s.count('1')
	if z > o:
		p = '0'
		gg = p * n
		print(gg)
	else:
		p = '1'
		gg = p * n
		print(gg)


T = int(input())
for _ in range(T):
	N = int(input())
	s = input()
	res = ''
	for i in range(0, len(s), 2):
		res += s[i]
	print(res)


def get_int():
	return int(input())
t = get_int()
for i in range(0, t):
	n = get_int()
	s = input()
	r = ''
	for i in range(0, n):
		r += s[i * 2]
	print(r)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ans = ''
	cur = 0
	for i in range(len(s) - n + 1):
		for j in range(n):
			if j == cur:
				ans += s[i + j]
		cur += 1
	print(ans)


from math import log2, ceil
from heapq import heappush, heappop
from copy import deepcopy
from collections import deque, Counter as CC

def main():
	for t in range(int(input())):
		n = int(input())
		s = input()
		print(s[n - 1] * n)
main()


for _ in range(int(input())):
	n = int(input())
	s = input()
	k = 0
	prev = ''
	ans = ''
	for i in range(n):
		st = s[i:i + n]
		if prev != st[k]:
			ans += st[k]
			k += 1
	print(ans)


import sys
import time, math as mt, bisect, sys
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict

def si():
	return int(sys.stdin.readline())

def st():
	return stdin.readline()

def mi():
	return map(int, sys.stdin.readline().split())

def lis():
	return list(map(int, sys.stdin.readline().split()))

def lcm(a, b):
	return a * b // gcd(a, b)

def gcd(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	if a > b:
		return gcd(a % b, b)
	else:
		return gcd(a, b % a)
test = si()
for _ in range(test):
	n = si()
	string = st()
	print(string[n - 1] * n)


for i in range(int(input())):
	n = int(input())
	s = input()
	w = s[n - 1] * n
	print(w)


import math
l = int(input())
for p in range(l):
	n = int(input())
	s = str(input())
	print(s[n - 1] * n)


test = int(input())
for _ in range(test):
	n = int(input())
	string = str(input())
	temp = ''
	for i in range(0, 2 * n - 1, 2):
		temp += string[i]
	print(temp)


n = int(input())
saida = []
for i in range(n):
	n1 = int(input())
	string_b = input()
	s = ''
	for j in range(n1):
		sub_str = string_b[j:j + n1]
		s += sub_str[j]
	saida.append(s)
for k in saida:
	print(k)


for t in range(int(input())):
	n = int(input())
	s = input().rstrip()
	print(s[n - 1] * n)


t = int(input())
while True:
	if t == 0:
		break
	t -= 1
	n = int(input())
	vals = []
	a = input()
	for i in range(len(a)):
		if i == n:
			break
		vals.append(a[i:i + n])
	ans = ['0' for i in range(n)]
	for i in range(n):
		if len(vals) == 0:
			break
		x = vals[0][i]
		ans[i] = x
		newVals = []
		for aa in vals:
			if aa[i] == x:
				continue
			else:
				newVals.append(aa)
		vals = newVals
	print(''.join(ans))


for _ in range(int(input())):
	n = int(input())
	s = input()
	c = s[len(s) // 2]
	print(c * (len(s) // 2 + 1))


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(int(input()).split())

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
x = inp()
anslist = []
for i in range(x):
	bsub = []
	answer = 0
	y = inp()
	ych = y
	bstr = input()
	bstrlt = [char for char in bstr]
	bstrlt.remove('\n')
	for i in range(y):
		bsub.append(bstrlt[ych - y:ych])
		ych += 1
	zeroes = 0
	ones = 0
	counterb = 0
	for i in range(y):
		if '0' in bsub[counterb] or '1' in bsub[counterb]:
			if '0' in bsub[counterb]:
				zeroes += 1
			if '1' in bsub[counterb]:
				ones += 1
		counterb += 1
	if zeroes == y:
		answer = '0' * y
		anslist.append(answer)
	elif ones == y:
		answer = '1' * y
		anslist.append(answer)
for i in anslist:
	print(i)


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	x = '0' * n
	y = '1' * n
	if x in s:
		print(x)
	else:
		print(y)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def solve():
	n = int(inp())
	s = inp()
	print(s[n - 1] * n)
testcase(int(inp()))


def lst(n, x):
	if n == 1:
		return [i for i in x]
	l = []
	for i in range(len(x)):
		s = x[i:i + n]
		if len(s) < n:
			return l
		l.append(s)

def ck(arr, pos):
	(x, y) = ('0', '1')
	(p, q) = (0, 0)
	for i in arr:
		if i[pos] == '0':
			p = p + 1
		else:
			q = q + 1
	return [q, p]

def rem(arr, n, d):
	for i in arr:
		if i[n] == d:
			arr.remove(i)
	return arr
for _ in range(int(input())):
	n = int(input())
	s = input()
	arr = lst(n, s)
	sim = ['0' for i in range(n)]
	for i in range(n):
		m = ck(arr, i)
		y = '1' if m[0] > m[1] else '0'
		sim[i] = y
		arr = rem(arr, i, y)
	print(''.join(sim))


mod = 10 ** 9 + 7

def solve():
	n = int(input())
	s = input()
	ans = ''
	for i in range(0, 2 * n, 2):
		ans += s[i]
	print(ans)
t = int(input())
while t > 0:
	solve()
	t -= 1


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	res = ''
	k = 0
	j = n * 2 - 2
	for i in range(n):
		res += s[k]
		k += 2
	print(res)
	t -= 1


def calcula_correspondente(n, string_binaria):
	string_correspondente = []
	aux = 0
	for i in range(n):
		substring_binaria = string_binaria[i:i + n]
		if len(substring_binaria) == n:
			string_correspondente.append(substring_binaria[aux])
			aux += 1
	return string_correspondente
numero_de_testes = int(input())
for i in range(numero_de_testes):
	n = int(input())
	string_binaria = list(input())
	saida = calcula_correspondente(n, string_binaria)
	print(''.join(saida))


t = input()
t = int(t)
for i in range(t):
	n = input()
	n = int(n)
	arr = input()
	s = ''
	for j in range(len(arr)):
		s2 = arr[j:j + n]
		j = j + 1
		j = j % n
		s = s + s2[j - 1]
		if len(s) == n:
			break
	print(s)


for _ in range(int(input())):
	n = int(input())
	s = input()
	ans = s[0]
	for i in range(1, n):
		if ans[0] == s[i]:
			continue
		j = i + 1
		k = 1
		flag = 0
		while k < len(ans):
			if ans[k] == s[j]:
				flag = 1
				break
			k += 1
			j += 1
		if flag == 0:
			ans += s[j]
	ans += '0' * (n - len(ans))
	print(ans)


t = int(input())
while t:
	t -= 1
	n = int(input())
	s = list(input())
	mainflag = 0
	if n == 1:
		print(s[0])
	else:
		temp = []
		for i in range(n):
			a = int(s[i])
			for j in range(i + 1, n + i):
				a = a & int(s[j])
			temp.append(str(a))
		print(''.join(temp))


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from bisect import bisect_left
from bisect import bisect_right

def L():
	return list(map(int, stdin.readline().split()))

def In():
	return map(int, stdin.readline().split())

def I():
	return int(stdin.readline())
P = 1000000007

def main():
	for t in range(I()):
		n = I()
		s = input()
		st = ''
		for i in range(0, 2 * n - 1, 2):
			st += s[i]
		print(st)
main()


def solve():
	n = int(input())
	st = str(input())
	print(st[n - 1] * n)
t = int(input())
for i in range(t):
	solve()


t = int(input())
for t in range(t):
	n = int(input())
	s = input()
	a = [int(x) for x in s]
	p = a[n - 1]
	print(str(p) * n)


t = int(input().strip())
while t:
	t -= 1
	n = int(input().strip())
	st = input()
	new_st = ''
	for i in range(n):
		new_st = new_st + st[2 * i]
	print(new_st)


for t in range(int(input())):
	n = int(input())
	s = input()
	(one, zero) = (0, 0)
	for i in range(2 * n - 1):
		if s[i] == '0':
			zero += 1
		if s[i] == '1':
			one += 1
	if one > zero:
		print('1' * n)
	else:
		print('0' * n)


import sys

def main():
	tn = int(input())
	for ti in range(tn):
		n = int(input())
		L = input().strip()
		print(L[n - 1] * n)
main()


t = int(input())
for tt in range(0, t):
	n = int(input())
	s = input()
	print(s[n - 1] * n)


import heapq as hq
from heapq import heappop, heappush
from collections import deque, defaultdict, Counter
from sys import stdin, stdout

def inp():
	return int(stdin.readline())

def inlt():
	return list(map(int, stdin.readline().split()))

def insr():
	return list(stdin.readline().strip())

def invr():
	return map(int, stdin.readline().split())

def pr(n):
	stdout.write(str(n) + '\n')

def subset_sum_count(arr, n, sum):
	dp = [[0 for _ in range(sum + 1)] for _ in range(n + 1)]
	for i in range(n + 1):
		for j in range(sum + 1):
			if j == 0:
				dp[i][j] = 1
			elif arr[i - 1] <= j:
				dp[i][j] = dp[i - 1][j - arr[i - 1]] + dp[i - 1][j]
			else:
				dp[i][j] = dp[i - 1][j]
	return dp[n][sum]

def prefix(a):
	pre = []
	pre.append(a[0])
	for i in range(1, len(a)):
		pre.append(pre[i - 1] + a[i])
	return pre

def binary_search(func, lo, hi, abs_prec=1e-07):
	while abs(hi - lo) > abs_prec:
		mi = lo + (hi - lo) / 2
		if func(mi):
			hi = mi
		else:
			lo = mi
	return (lo + hi) / 2

def ternary_search(func, lo, hi, abs_prec=1e-07):
	while abs(hi - lo) > abs_prec:
		lo_third = lo + (hi - lo) / 3
		hi_third = hi - (hi - lo) / 3
		if func(lo_third) < func(hi_third):
			lo = lo_third
		else:
			hi = hi_third
	return (lo + hi) / 2

def discrete_binary_search(func, lo, hi):
	while lo < hi:
		mi = lo + (hi - lo) // 2
		if func(mi):
			hi = mi
		else:
			lo = mi + 1
	return lo

def discrete_ternary_search(func, lo, hi):
	while lo <= hi:
		lo_third = lo + (hi - lo) // 3
		hi_third = lo + (hi - lo) // 3 + (1 if 0 < hi - lo < 3 else (hi - lo) // 3)
		if func(lo_third) < func(hi_third):
			lo = lo_third + 1
		else:
			hi = hi_third - 1
	return lo
	return -1

def right_rotate(a, s):
	return a[s:] + a[:s]

def dec_to_bin(x):
	return int(bin(x)[2:])

def str_to_integer_list(n):
	a = []
	for i in range(len(n)):
		a.append(int(n[i]))
	return a

def list_to_str(l):
	s = ''
	for i in l:
		s += str(i)
	return s

def dijkstra(s, N, E):
	visited = set()
	dist = {}
	for i in range(1, N + 1):
		dist[i] = 1 << 29
	queue = [(dist[i], i) for i in range(1, N + 1)]
	hq.heappush(queue, (0, s))
	dist[s] = 0
	while queue:
		(d, u) = hq.heappop(queue)
		if u in visited:
			continue
		for t in E[u]:
			(v, r) = t
			if dist[v] > d + r:
				dist[v] = d + r
				hq.heappush(queue, (dist[v], v))
		visited.add(u)
	return dist

def prime_sieve(n):
	flag = n % 6 == 2
	sieve = bytearray((n // 3 + flag >> 3) + 1)
	for i in range(1, int(n ** 0.5) // 3 + 1):
		if not sieve[i >> 3] >> (i & 7) & 1:
			k = 3 * i + 1 | 1
			for j in range(k * k // 3, n // 3 + flag, 2 * k):
				sieve[j >> 3] |= 1 << (j & 7)
			for j in range(k * (k - 2 * (i & 1) + 4) // 3, n // 3 + flag, 2 * k):
				sieve[j >> 3] |= 1 << (j & 7)
	return sieve

def prime_list(n):
	res = []
	if n > 1:
		res.append(2)
	if n > 2:
		res.append(3)
	if n > 4:
		sieve = prime_sieve(n + 1)
		res.extend((3 * i + 1 | 1 for i in range(1, (n + 1) // 3 + (n % 6 == 1)) if not sieve[i >> 3] >> (i & 7) & 1))
	return res

def dijkstra(n, graph, start):
	(dist, parents) = ([float('inf')] * n, [-1] * n)
	dist[start] = 0
	queue = [(0, start)]
	while queue:
		(path_len, v) = heappop(queue)
		if path_len == dist[v]:
			for (w, edge_len) in graph[v]:
				if edge_len + path_len < dist[w]:
					(dist[w], parents[w]) = (edge_len + path_len, v)
					heappush(queue, (edge_len + path_len, w))
	return (dist, parents)

def path(start, end, parent):
	path = [end]
	while path[-1] != start:
		path.append(parent[path[-1]])
	path.reverse()
	return path

def bfs(graph, start, end):
	parent = {}
	queue = []
	queue.append(start)
	while queue:
		node = queue.pop(0)
		if node == end:
			return path(start, end, parent)
		for next in graph.get(node, []):
			if node not in queue:
				parent[next] = node
				queue.append(next)

def most_frequent(List):
	return max(set(List), key=List.count)

def subarray(arr, n):
	(ans, temp) = (1, 1)
	for i in range(1, n):
		if arr[i] == arr[i - 1]:
			temp = temp + 1
		else:
			ans = max(ans, temp)
			temp = 1
	ans = max(ans, temp)
	return ans

def solve(n):
	l = []
	while n != 0:
		if n % 10 != 7 and n % 10 != 4:
			return False
	return True

def lucky(n):
	l = []
	while n > 0:
		x = n % 10
		l.append(x)
		n = n // 10
	if l.count(4) + l.count(7) == len(l):
		return True
	else:
		return False

def solve():
	for _ in range(inp()):
		n = inp()
		s = input()
		print(s[n - 1] * n)
solve()


n = int(input())
for t in range(n):
	y = int(input())
	x = str(input())
	l = list(map(int, x))
	a = l.count(1)
	b = l.count(0)
	if a > b:
		for i in range(y):
			print(1, end='')
	else:
		for i in range(y):
			print(0, end='')
	print()


for _ in range(int(input())):
	n = int(input())
	s = input()
	i = 0
	while i < len(s):
		print(s[i], end='')
		i += 2
	print()


T = int(input())
for i in range(0, T):
	n = int(input())
	s = input()
	w = ''
	j = 0
	while j < 2 * n - 1:
		w += s[j]
		j += 2
	print(w)


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	line = input()
	x = line[n - 1]
	ans = ''
	for i in range(0, n):
		ans = ans + x
	print(ans)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect, fractions
from collections import deque, defaultdict, OrderedDict
from fractions import Fraction
from decimal import Decimal

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(ri()):
		n = ri()
		s = rs()
		z = ''
		for i in range(0, len(s), 2):
			z += s[i]
		print(z)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			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, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			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()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


for i in range(int(input())):
	n = int(input())
	s = str(input())
	k = s[n - 1]
	ans = ''
	ans += k
	ans += k * (n - 1)
	print(ans)


for _ in range(int(input())):
	n = int(input())
	s = input()
	final = []
	for i in range(0, 2 * n - 1, 2):
		final.append(s[i])
	print(''.join(final))


def main():
	t = 1
	t = int(input())
	while t:
		solve()
		t -= 1

def solve():
	n = int(input())
	v = input()
	print(v[0:2 * n - 1:2])
	return
main()


import sys
test = int(input())
for i in range(test):
	n = int(input())
	s = input()
	ans = s[n - 1] * n
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	s1 = ''
	count = 0
	for i in range(n):
		s1 = s1 + s[i + count]
		count = count + 1
	print(s1)


def main():
	t = int(input())
	while t > 0:
		n = int(input())
		li = input()
		com = li[n - 1]
		li = list([com] * n)
		for i in li:
			print(i, end='')
		print()
		t -= 1
main()


def use_fast_io():
	import sys

	class InputStorage:

		def __init__(self, lines):
			lines.reverse()
			self.lines = lines

		def input_func(self):
			if self.lines:
				return self.lines.pop()
			else:
				return ''
	input_storage_obj = InputStorage(sys.stdin.readlines())
	return input_storage_obj.input_func
input = use_fast_io()
test = int(input())
for i in range(test):
	n = int(input())
	b = str(input())
	print(b[0::2])


import sys
input = sys.stdin.readline
from collections import *
for _ in range(int(input())):
	n = int(input())
	s = input()[:-1]
	ans = []
	for i in range(0, 2 * n - 1, 2):
		ans.append(s[i])
	print(''.join(ans))


def solve(n, s):
	out = ''
	i = 0
	while len(out) < n:
		out += s[i]
		i += 2
	return out
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	print(solve(n, s))


for i in range(int(input())):
	n = int(input())
	str = input()
	print(str[::2])


import math, sys
from collections import defaultdict, Counter, deque
INF = float('inf')
MOD = 10 ** 9 + 7

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def isPrime(n):
	if n <= 1:
		return False
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			return False
		i += 1
	return True

def primeFactors(n):
	factors = []
	i = 2
	while i ** 2 <= n:
		while n % i == 0:
			factors.append(i)
			n //= i
		i += 1
	if n > 1:
		factors.append(n)
	return factors

def vars():
	return map(int, input().split())

def array():
	return list(map(int, input().split()))

def main():
	n = int(input())
	s = input()
	nl = len(s)
	ans1 = '1' * n
	ans2 = '0' * n
	o = False
	t = False
	l = 0
	r = n
	while r <= nl:
		if s[l:r] == ans1:
			o = True
			break
		elif s[l:r] == ans2:
			t = True
			break
		l += 1
		r += 1
	if not o and (not t):
		print(ans1)
	elif o:
		print(ans1)
	else:
		print(ans2)
t = 1
t = int(input())
for _ in range(t):
	main()


test = int(input())
for t in range(test):
	n = int(input())
	s = input()
	l = ''
	for i in range(0, 2 * n, 2):
		l += s[i]
	print(l)


n = int(input())
cases = [(int(input()), input()) for _ in range(n)]
for case in cases:
	answer = ['0'] * case[0]
	lst = case[1]
	for m in range(case[0]):
		for i in range(m, m + case[0]):
			if lst[i + m] == answer[m]:
				break
			else:
				answer[m] = lst[i + m]
				break
	print(''.join(answer))


rondas = int(input())
listaResultados = []
for i in range(rondas):
	n = int(input())
	cadena = input()
	lista = []
	w = ''
	for j in range(n):
		lista.append(cadena[0 + j:n + j])
	for k in range(n):
		w = w + lista[k][k]
	listaResultados.append(w)
for i in range(len(listaResultados)):
	print(listaResultados[i])


def handleSimilar(s, n):
	out = ''
	for i in range(n):
		out += s[i:n + i][i]
	print(out)
for i in range(int(input())):
	n = int(input())
	s = input()
	if n == 1:
		print(s)
	else:
		handleSimilar(s, n)


def fun():
	n = int(input())
	s = input()
	print(s[n - 1] * n)
t = int(input())
for i in range(t):
	fun()


for _ in range(int(input())):
	n = int(input())
	s = input()
	ans = list(s[0:n])
	for i in range(1, n):
		ans[i] = s[i:n + i][i]
	for i in range(n):
		print(ans[i], end='')
	print()


T = int(input().rstrip())
for test in range(T):
	n = int(input().rstrip())
	input_str = input().rstrip()
	foo = ''
	for idx in range(len(input_str)):
		if idx % 2 == 0:
			foo = foo + input_str[idx]
	print(foo)


ii = lambda : int(input())
si = lambda : input()
for _ in range(ii()):
	n = ii()
	MDL = 0
	a = si()
	if a.count('1') <= a.count('0'):
		print('0' * n)
	else:
		print('1' * n)


import math
t = int(input())
for _ in range(0, t):
	n = int(input())
	a = input()
	p = ''
	i = 0
	while i < len(a):
		p = p + a[i]
		i = i + 2
	print(p)


t = int(input())
while t != 0:
	t -= 1
	n = int(input())
	s = input()
	res = [s[n - 1]] * n
	print(''.join(res))


for _ in range(int(input())):
	n = int(input())
	a = list(input())
	b = ''
	for i in range(0, len(a), 2):
		b += a[i]
	print(b)


import sys
T = int(sys.stdin.readline())
while T:
	n = int(sys.stdin.readline())
	s = sys.stdin.readline()
	mask = s[:n]
	for l in range(n):
		r = l + n
		substring = s[l:r]
		new_mask = []
		for (idx, char) in enumerate(substring):
			if char == mask[idx]:
				new_mask.append(char)
			else:
				new_mask.append('0')
		mask = ''.join(new_mask)
	print(mask)
	T -= 1


for _ in range(int(input())):
	n = int(input())
	c = input()
	c = c[len(c) // 2]
	print(c * n)


from sys import stdin, stdout, setrecursionlimit
from collections import deque, defaultdict, Counter
from heapq import heappush, heappop
from functools import lru_cache
import math
rl = lambda : stdin.readline()
rll = lambda : stdin.readline().split()
rli = lambda : map(int, stdin.readline().split())
rlf = lambda : map(float, stdin.readline().split())
(INF, NINF) = (float('inf'), float('-inf'))
MOD = 10 ** 9 + 7

def main():
	T = int(rl())
	for _ in range(T):
		n = int(rl())
		s = rll()[0]
		w = []
		for i in range(n):
			w.append(s[2 * i])
		print(''.join(w))
	stdout.close()
main()


for _ in range(int(input())):
	n = int(input())
	s = list(map(int, input()))
	l = s[::2]
	print(*l, sep='')


import sys
from collections import defaultdict as dc
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	s = list(input())
	print(''.join(s[::2]))


t = int(input())
for j in range(t):
	n = int(input())
	s = input()
	i = 0
	x = ''
	while i < n:
		if 2 * i < 2 * n - 1:
			x += s[2 * i]
		i += 1
	print(x)


for i in range(int(input())):
	n = int(input())
	s = input()
	l = list(s)
	if l.count('1') >= l.count('0'):
		for i in range(n):
			print(1, end='')
	else:
		for i in range(n):
			print(0, end='')
	print()


n = int(input())
for _ in range(n):
	l = int(input())
	s = input()
	z = 0
	o = 0
	for c in s:
		if c == '0':
			z += 1
		elif c == '1':
			o += 1
	if z > o:
		print('0' * l)
	else:
		print('1' * l)


import sys
inputlines = sys.stdin.readlines()
number_of_testcases = int(inputlines[0])
for i in range(number_of_testcases):
	n = int(inputlines[2 * i + 1])
	string = inputlines[2 * i + 2]
	character = string[n - 1]
	result = character * n
	print(result)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	subs = [s[k] for k in range(n)]
	for i in range(n - 1):
		temp1 = ''.join((subs[k] for k in range(n)))
		temp2 = s[i + 1:i + n + 1]
		for j in range(n):
			if temp1[j] == temp2[j]:
				continue
			else:
				subs[j] = 'x'
	for i in range(n):
		if subs[i] == 'x':
			subs[i] = '0'
	res = ''.join((subs[k] for k in range(n)))
	print(res)


for _ in range(int(input())):
	n = int(input())
	s = input()
	l = []
	l[:0] = s
	if n == 1:
		print(s)
		continue
	a = []
	ans = [0] * n
	f = 0
	for i in range(n):
		a.append(l[i:i + n])
	for j in range(n):
		c = 0
		for i in range(n - 1):
			if a[i][j] == a[i + 1][j]:
				c += 1
		if c == n - 1:
			ans[j] = a[i - 1][j]
	for i in range(n):
		print(ans[i], end='')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	sn = input()
	ans = []
	for i in range(n):
		st = sn[i:n + i]
		ans.append(st[i])
	print(*ans, sep='')


for _ in range(int(input())):
	n = int(input())
	a = input()
	s = [0] * n
	for i in range(n):
		s[i] = a[2 * i]
	print(''.join(s))


T = int(input())
while T != 0:
	n = int(input())
	s = input()
	z = 0
	r = 0
	for i in range(0, n):
		if '0' in s[i:i + n]:
			z = z + 1
		if '1' in s[i:i + n]:
			r = r + 1
	if z == n:
		for i in range(0, n):
			print('0', end='')
	elif r == n:
		for i in range(0, n):
			print('1', end='')
	print('\n', end='')
	T = T - 1


import sys, math
try:
	(sys.stdin, sys.stdout) = (open('input.txt', 'r'), open('out.txt', 'w'))
except:
	pass
from sys import stdin, stdout
mod = int(1000000000.0 + 7)
from statistics import mode
from collections import *
from math import ceil, floor, inf, factorial, gcd, log2, sqrt, log
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()

def lcm(a, b):
	return a * b // gcd(a, b)

def setbits(n):
	return bin(n).count('1')

def resetbits(n):
	return bin(n).count('0')

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r):
	(num, den) = (1, 1)
	r = min(n, n - r)
	for i in range(r):
		num *= n - i
		den *= i + 1
	return num // den

def ncr_p(n, r, p):
	(num, den) = (1, 1)
	r = min(r, n - r)
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * modinv(den, p) % p

def isPrime(num):
	if num <= 1:
		return False
	if num == 2 or n == 3:
		return True
	if num % 2 == 0 or num % 3 == 0:
		return False
	m = int(num ** 0.5) + 1
	for i in range(5, m, 6):
		if num % i == 0 or num % (i + 2) == 0:
			return False
	return True

def bin_search(arr, low, high, val):
	while low <= high:
		mid = low + (high - low) // 2
		if arr[mid] == val:
			return mid
		elif arr[mid] < val:
			low = mid + 1
		else:
			high = mid - 1
	return -1

def sumofdigit(num):
	count = 0
	while num:
		count += num % 10
		num //= 10
	return count

def inputmatrix():
	(r, c) = iia()
	mat = [0] * r
	for i in range(r):
		mat[i] = iia()
	return (r, c, mat)

def prefix_sum(n, arr):
	for i in range(1, n):
		arr[i] += arr[i - 1]
	return arr

def binomial(n, k):
	if 0 <= k <= n:
		ntok = 1
		ktok = 1
		for t in range(1, min(k, n - k) + 1):
			ntok *= n
			ktok *= t
			n -= 1
		return ntok // ktok
	else:
		return 0

def divisors(n):
	res = []
	for i in range(1, ceil(sqrt(n)) + 1):
		if n % i == 0:
			if i == n // i:
				res.append(i)
			else:
				res.append(i)
				res.append(n // i)
	return res
for _ in range(ii1()):
	n = ii1()
	s = is1()
	ans = 0
	flag = True
	for i in range(0, n):
		ss = '0b'
		for j in range(i, i + n):
			ss += s[j]
		if flag:
			ans = int(ss, 2)
			flag = False
		else:
			ans &= int(ss, 2)
	a = bin(ans)[2:]
	rem = n - len(a)
	res = '0' * rem + a
	print(res)


t = int(input())
myList = []
for _ in range(t):
	n = int(input())
	s = input()
	new = ''
	for i in range(2 * n - 1):
		if i % 2 == 0:
			new += s[i]
	myList.append(new)
for elem in myList:
	print(elem)


def solve(n, string):
	return string[n - 1] * n

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		string = input()
		answer = solve(n, string)
		print(answer)
main()


n = int(input())
l = []
for i in range(n):
	m = int(input())
	s = str(input())
	f = ''
	if len(s) == 1:
		l.append(s)
	else:
		for j in range(0, len(s) - m + 1):
			e = s[j:j + m]
			f = f + e[j]
		l.append(f)
for i in range(0, len(l)):
	print(l[i])


out = []
T = int(input())
for i in range(T):
	n = int(input())
	s = input()
	x = ''
	j = 0
	k = 0
	while j + k < len(s):
		x += s[j + k]
		j += 1
		k += 1
	if len(x) != n:
		x += x[:n - len(x)]
	out.append(x)
for i in out:
	print(i)


T = int(input())
for t in range(T):
	N = int(input())
	S = input()
	ans = [S[N - 1]] * N
	print(''.join(ans))


TC = int(input())
for tc in range(TC):
	N = int(input())
	S = input()
	result = [S[i] for i in range(N)]
	pos = 1
	for j in range(1, N):
		if result[pos] != S[j + pos]:
			result[pos] = S[j + pos]
		pos += 1
	print(''.join(result))


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]
for _ in range(II()):
	n = II()
	s = SI()
	ans = s[n - 1] * n
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [int(x) for x in input()]
	count = 0
	count1 = 0
	for each in arr:
		if each == 0:
			count += 1
		else:
			count1 += 1
	if count > count1:
		for i in range(n):
			print('0', end='')
		print()
	else:
		for i in range(n):
			print('1', end='')
		print()


t = int(input())
for _ in range(t):
	(n, s) = (int(input()), input())
	last_p = len(s) - n + 1
	c = [s[i:i + n] for i in range(0, last_p)]
	d = [c[i][i] for i in range(n)]
	print(''.join(d))


T = int(input())
while T:
	n = int(input())
	s = list(input())
	r = ''
	for i in range(0, 2 * n - 1, 2):
		r = r + s[i]
	print(r)
	T = T - 1


for _ in range(int(input())):
	n = int(input())
	s = input()
	k = len(s) // 2
	p = s[k]
	ans = n * p
	print(ans)


t = int(input())
for t_index in range(t):
	n = int(input())
	s = input()
	w = ''
	for (i, item) in enumerate(s):
		if i % 2 == 0:
			w += item
	print(w)


import math
from decimal import *
import random
for _ in range(int(input())):
	n = int(input())
	rs = list(input())
	for mask in range(2 ** n):
		s = ''
		for i in range(n):
			if mask >> i & 1:
				s += '1'
			else:
				s += '0'
		ok = 0
		for i in range(n):
			for j in range(i, i + n):
				if rs[j] == s[j - i]:
					ok += 1
					break
		if ok == n:
			print(s)
			break


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ans = (1 << n) - 1
	for i in range(n):
		ans &= int(s[i:i + n], 2)
	print(bin(ans)[2:].zfill(n))


def haha(a, b):
	for i in range(len(a)):
		print(b[i][a[i] - 1] * a[i])
t = int(input())
n = []
s = []
while t > 0:
	x = int(input())
	n.append(x)
	y = str(input())
	assert len(y) == 2 * x - 1, 'Input Length incorrect'
	s.append(y)
	t -= 1
haha(n, s)


res = ''
for _ in range(int(input())):
	input()
	res += f'{input()[::2]}\n'
print(res)


t = int(input())
for i in range(t):
	n = int(input())
	a = input()
	z = []
	for i in range(len(a)):
		if i == 0 or i % 2 == 0:
			z.append(a[i])
	print(*z, sep='')


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	a = len(s) // 2
	print(s[a] * n)


def similar(n, s):
	length = n
	new = ''
	alvo = s[length - 1]
	for e in range(length):
		new += alvo
	return new
t = int(input())
for a in range(t):
	n = int(input())
	s = input()
	print(similar(n, s))


import sys
import math
fileoperation = 0
if fileoperation:
	orig_stdout = sys.stdout
	orig_stdin = sys.stdin
	inputfile = open('W:/Competitive Programming/input.txt', 'r')
	outputfile = open('W:/Competitive Programming/output.txt', 'w')
	sys.stdin = inputfile
	sys.stdout = outputfile
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans
t = int(input())
for tt in range(t):
	n = int(input())
	s = str(input())
	i = 0
	ans = ''
	while i < len(s):
		ans += s[i]
		i += 2
	print(ans)
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


t = int(input())
answers = []
for i in range(t):
	n = int(input())
	bstring = input()
	arr1 = []
	for i in range(len(bstring)):
		arr1.append(int(bstring[i]))
	arr2 = []
	for i in range(len(arr1) + 1 - n):
		arr = []
		for j in range(i, n + i):
			arr.append(arr1[j])
		arr2.append(arr)
	arr3 = []
	for i in range(len(arr2)):
		arr3.append(arr2[i][i])
	string1 = ''
	for i in range(len(arr3)):
		string1 += str(arr3[i])
	answers.append(string1)
for i in range(len(answers)):
	print(answers[i])


exec(int(input()) * 'x,y=input(),input();print(y[::2]);')


import sys
T = int(sys.stdin.readline().strip())
for t in range(0, T):
	n = int(sys.stdin.readline().strip())
	s = sys.stdin.readline().strip()
	print(s[n - 1] * n)


T = int(input())
for i in range(T):
	N = int(input())
	S = input()
	F = ''
	for j in range(N):
		Check = S[j:N + j]
		F += Check[j]
	print(F)


for _ in range(int(input())):
	n = int(input())
	s = [x for x in input()]
	l = []
	for x in range(0, n):
		a = s[x:x + n]
		l.append(a[x])
	print(''.join(l))


t = int(input())
for xx in range(t):
	n = int(input())
	s = input()
	string = ''
	for i in range(0, 2 * n, 2):
		string += s[i]
	print(string)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
from decimal import Decimal
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var, end='\n'):
	sys.stdout.write(str(var) + end)

def outa(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]

def check(s1, s2):
	for i in range(n):
		if i + n > 2 * n - 1:
			break
		temp = s1[i:i + n]
		r = False
		for j in range(n):
			if temp[j] == s2[j]:
				r = True
				break
		if not r:
			return False
	return True
for _ in range(int(data())):
	n = int(data())
	s = data()
	(first, second) = ('1' * n, '0' * n)
	(third, fourth) = ('0', '1')
	for i in range(n - 1):
		third += fourth[-1]
		fourth += third[-2]
	if check(s, first):
		out(first)
		continue
	if check(s, second):
		out(second)
		continue
	if check(s, third):
		out(third)
		continue
	out(fourth)


for _ in range(int(input())):
	n = int(input())
	s = str(input())
	for i in range(2 * n - 1):
		if i % 2 == 0:
			print(s[i], end='')
	print()


for _ in range(int(input())):
	n = int(input())
	s = input()
	c0 = 0
	c1 = 0
	for x in s:
		if x == '0':
			c0 += 1
		else:
			c1 += 1
	ans = ''
	if c1 == 0 or c1 <= n - 1:
		for i in range(n):
			ans += '0'
		print(ans)
	elif c0 == 0 or c0 <= n - 1:
		for i in range(n):
			ans += '1'
		print(ans)
	else:
		for i in range(n):
			if i % 2 == 0:
				ans += '1'
			else:
				ans += '0'
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	a = input()
	b = a[n - 1]
	ans = ''
	for i in range(n):
		ans += b
	print(ans)


import math

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b / gcd(a, b)

def bs(arr, l, r, x):
	while l <= r:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return arr[mid]
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1

def swap(list, pos1, pos2):
	(list[pos1], list[pos2]) = (list[pos2], list[pos1])
	return list

def subarrayBitwiseOR(A):
	res = set()
	pre = {0}
	for x in A:
		pre = {x | y for y in pre} | {x}
		res |= pre
	return len(res)
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	x = 0
	ans = ''
	for i in range(n):
		ans += s[x]
		x += 2
	print(ans)


for j in range(int(input())):
	a = int(input())
	b = input()
	va = b[a - 1]
	va = va * a
	print(va)


t = int(input())

def ans(n, x):
	for i in range(n):
		print(x, end='')
	print()
	return
for _ in range(t):
	n = int(input())
	s = input()
	(s1, s2) = (s[:n], s[n - 1:])
	cnt = [0, 0]
	for b in list(s1) + list(s2):
		cnt[int(b)] += 1
	key = ''
	for (idx, e) in enumerate(cnt):
		if e >= n:
			key = idx
	ans(n, key)


for _ in range(int(input())):
	x = int(input())
	s = input()
	answer = ''
	s = list(s)
	for i in range(len(s)):
		if i % 2 == 0:
			answer += s[i]
	print(answer)


def bin():
	n = int(input())
	a = str(input())
	a.split()
	for i in range(n):
		print(*a[i * 2], end='', sep='/n')
	print('\n')
t = int(input())
for i in range(t):
	b = bin()


for _ in range(0, int(input())):
	n = int(input())
	s = input()
	l = []
	i = 0
	while i < 2 * n - 1:
		l.append(s[i])
		i += 2
	for x in l:
		print(x, end='')
	print()


def solve(n, s):
	result = ''
	i = 0
	if s.count('0') == len(s) or s.count('1') == len(s):
		return s[:n]
	if s == '101':
		return '00'
	elif s == '010':
		return '11'
	while i < len(s):
		result += s[i]
		i += 2
	return result
t = int(input())
for _ in range(t):
	n = int(input())
	s = str(input())
	print(solve(n, s))


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from bisect import bisect_right as br
from bisect import bisect
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()
from random import randint
from collections import defaultdict, deque

class Graph(object):

	def __init__(self, dic):
		self.dict = dic
		self.vertex = set()

	def addedge(self, a, b):
		if self.dict[a] == []:
			self.vertex.add(a)
		if b != None:
			self.dict[a].append(b)

	def con_com_util(self, i, unvisited, count, comp):
		for j in self.dict[i]:
			if j in unvisited:
				unvisited.remove(j)
				comp[count].append(j)
				comp = self.con_com_util(j, unvisited, count, comp)
		return comp

	def conn_components(self):
		unvisited = self.vertex.copy()
		count = 0
		comp = defaultdict(list)
		while unvisited:
			i = unvisited.pop()
			comp[count].append(i)
			comp = self.con_com_util(i, unvisited, count, comp)
			count += 1
		return (count, comp)

def countSetBits(n):
	count = 0
	while n:
		n &= n - 1
		count += 1
	return count
import random

def primesbelow(N):
	correction = N % 6 > 1
	N = {0: N, 1: N - 1, 2: N + 4, 3: N + 3, 4: N + 2, 5: N + 1}[N % 6]
	sieve = [True] * (N // 3)
	sieve[0] = False
	for i in range(int(N ** 0.5) // 3 + 1):
		if sieve[i]:
			k = 3 * i + 1 | 1
			sieve[k * k // 3::2 * k] = [False] * ((N // 6 - k * k // 6 - 1) // k + 1)
			sieve[(k * k + 4 * k - 2 * k * (i % 2)) // 3::2 * k] = [False] * ((N // 6 - (k * k + 4 * k - 2 * k * (i % 2)) // 6 - 1) // k + 1)
	return [2, 3] + [3 * i + 1 | 1 for i in range(1, N // 3 - correction) if sieve[i]]

def solve():
	n = int(inp())
	s = inp()
	ans = ''
	for i in range(len(s)):
		if i % 2 == 0:
			ans += s[i]
	print(ans)
testcase(int(inp()))


for _ in [0] * int(input()):
	n = int(input())
	arr = list(input())
	ans = []
	for i in range(n):
		ans.append(arr[i * 2])
	print(''.join(ans))


def main():
	t = int(input())
	while t > 0:
		n = int(input())
		s = str(input())
		chr = s[n - 1]
		res = ''
		for i in range(n):
			res += str(chr)
		print(res)
		t -= 1
	return
main()


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	print(''.join([s[n - 1] for _ in range(n)]))


import random

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)
for _ in range(int(input())):
	n = int(input())
	s = input()
	ans = [0] * n
	for i in range(len(s) - n + 1):
		t = s[i:i + n]
		if t[i] == '1':
			ans[i] = 1
	for i in ans:
		print(i, end='')
	print('')


t = int(input())
for q in range(t):
	n = int(input())
	ch = input()
	a = ch.count('0')
	b = ch.count('1')
	if a > b:
		print('0' * n)
	else:
		print('1' * n)


def solve():
	n = int(input())
	arr = input()
	for i in range(0, len(arr), 2):
		print(arr[i], end='')
	print()
test = int(input())
while test:
	solve()
	test -= 1


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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	li = []
	ss = {'1': set(), '0': set()}
	if n == 1:
		print(s)
		continue
	for (p, i) in enumerate(s):
		if p >= n - 1:
			ss[i].add(p)
			ss[s[p - n]].discard(p - n)
			if len(ss['0']) == 0:
				li.append(1)
			else:
				li.append(0)
		else:
			ss[i].add(p)
	print(*li, sep='')


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	res = []
	for i in range(0, 2 * n, 2):
		res.append(s[i])
	print(''.join(res))


t = int(input())
for j in range(t):
	n = int(input())
	p = input()
	c0 = 0
	c1 = 1
	for i in range(len(p)):
		if p[i] == '0':
			c0 += 1
		else:
			c1 += 1
	if c0 >= c1:
		print(n * '0')
	else:
		print(n * '1')


import random

def solve():
	n = int(input())
	s = input()
	while 1:
		ans = ''
		for i in range(n):
			ans += str(random.randint(0, 1))
		f = 1
		for i in range(n):
			if not any([s[i:i + n][j] == ans[j] for j in range(n)]):
				f = 0
		if f:
			break
	print(ans)
t = int(input())
for kk in range(t):
	solve()


from collections import deque, Counter
t = int(input())
while t:
	n = int(input())
	s = input()
	dq = deque()
	for i in range(n):
		dq.append(s[i])
	ans = ''
	ans += dq[0]
	k = 1
	for i in range(n, len(s)):
		dq.append(s[i])
		dq.popleft()
		ans += dq[k]
		k += 1
	print(ans)
	t -= 1


k = int(input())
for x in range(k):
	n = int(input())
	string = list(input())
	tamanho = 2 * n - 1
	saida = ''
	i = 0
	j = n
	c = 0
	while j <= tamanho:
		saida += string[i + c]
		i += 1
		j += 1
		c += 1
	print(saida)


import os, sys
from io import IOBase, BytesIO
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def get_input(a=str):
	return a(input())

def get_int_input():
	return get_input(int)

def get_input_arr(a):
	return list(map(a, input().split()))

def get_int_input_arr():
	return get_input_arr(int)

def solve():
	t = get_int_input()
	for _ in range(t):
		n = get_int_input()
		st = get_input()
		new_st = ''
		for i in range(n):
			new_st = new_st + st[i * 2]
		cout << new_st << endl

def main():
	solve()
main()


import sys

def print(*argv):
	n = len(argv)
	for i in range(n):
		if i == n - 1:
			sys.stdout.write(str(argv[i]) + '\n')
		else:
			sys.stdout.write(str(argv[i]) + ' ')

def lcm(x, y):
	from math import gcd
	return x * y / gcd(x, y)

def solve(n, s):
	ones = 0
	for i in s:
		if i == '1':
			ones += 1
	zeros = 2 * n - 1 - ones
	if ones >= zeros:
		return '1' * n
	else:
		return '0' * n
for _ in range(int(input())):
	n = int(input())
	s = input()
	print(solve(n, s))


for _ in range(int(input())):
	n = int(input())
	s = list(str(input()))
	zeros = s.count('0')
	ones = s.count('1')
	res = '0' if zeros > ones else '1'
	if n == 1:
		print(''.join(s))
	else:
		print(res * n)


for _ in range(int(input())):
	n = int(input())
	s = input().strip()
	print(s[n - 1] * n)


cases = int(input())
for i in range(cases):
	n = int(input())
	s = input()
	char = s[n - 1]
	print(char * n)


for _ in range(int(input())):
	n = int(input())
	str = input()
	one = str.count('1')
	print(str[n - 1] * n)


I = input
exec('for _ in range(int(I())): print(int(I())*""+I()[::2])')


from collections import Counter
import sys
import math as mt

def most_frequent(List):
	dict = {}
	(count, itm) = (0, '')
	for item in reversed(List):
		dict[item] = dict.get(item, 0) + 1
		if dict[item] >= count:
			(count, itm) = (dict[item], item)
	return itm
t = int(input())
while t > 0:
	n = int(input())
	s = input()
	d = ''
	for i in range(0, 2 * n - 1, 2):
		d += s[i]
	print(d)
	t -= 1


T = int(input())
for i in range(T):
	n = int(input())
	s = str(input())
	print(s[::2])


t = int(input())
result = list()
for test_case in range(t):
	n = int(input())
	string = input()
	result.append(n * string[n - 1])
for i in result:
	print(i)


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	op = []
	i = 0
	while i < n:
		op.append(s[i:i + n])
		i += 1
	ans = 0
	for i in op:
		ans = ans | int(i, 2)
	res = bin(ans)
	print('0' * (n - len(res) + 2) + res[2:])
	t -= 1


for _ in range(int(input())):
	n = int(input())
	st = list(input())
	s = ''
	num = 2 * n - 1
	for i in range(num):
		if i % 2 == 0:
			s = s + st[i]
	print(s)


def solution(caso):
	string_similar = caso[1][0]
	string_bilaria = caso[1]
	tamanho = caso[0]
	for i in range(1, len(string_bilaria) - tamanho + 1):
		if not is_similar(string_similar, string_bilaria[i:i + tamanho]):
			string_similar += string_bilaria[i + len(string_similar)]
	while len(string_similar) < tamanho:
		string_similar += '0'
	return string_similar

def is_similar(string_similar, string_bilaria):
	for i in range(len(string_similar)):
		if string_similar[i] == string_bilaria[i]:
			return True
	return False
numero_de_casos = int(input())
casos = []
for i in range(numero_de_casos):
	n = int(input())
	string_binaria = input()
	casos.append((n, string_binaria))
for caso in casos:
	print(solution(caso))


for i in range(int(input())):
	n = int(input())
	s = input()
	newS = s[n - 1] * n
	print(newS)


n = int(input())

def And(a, b):
	nat = ''
	for i in range(len(a)):
		if a[i] == b[i]:
			nat += a[i]
		else:
			nat += '2'
	return nat
for i in range(n):
	t = int(input())
	l = input()
	nat = l[0:t]
	for i in range(1, len(l) - t + 1):
		nat = And(nat, l[i:i + t])
	for i in range(len(nat)):
		if nat[i] == '2':
			nat = nat[:i] + '0' + nat[i + 1:]
	print(nat)


for i in range(int(input())):
	n = int(input())
	string = input()
	ans = ''
	for j in range(2 * n - 1):
		if j % 2 == 0:
			ans = ans + string[j]
	print(ans)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def gift():
	for _ in range(t):
		n = int(input())
		string = input()
		ans = []
		for i in range(n):
			ans.append(string[2 * i])
		yield ''.join(ans)
t = int(input())
ans = gift()
print(*ans, sep='\n')


for i in range(int(input())):
	n = int(input())
	s = input()
	ans = n * [s[n - 1]]
	print(*ans, sep='')


for _ in range(int(input())):
	n = int(input())
	arr = input()
	ans = ''
	for i in range(n):
		ans += arr[2 * i]
	print(ans)


import sys
import bisect as bi
import math
from collections import defaultdict as dd
import heapq
import itertools
input = sys.stdin.readline
mo = 10 ** 9 + 7

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
for _ in range(inin()):
	n = inin()
	s = sin().strip()
	ans = ''
	for i in range(0, 2 * n - 1, 2):
		ans += s[i]
	print(ans)


rr = lambda : input().strip()

def solve(n):
	s = rr()
	w = n * s[n - 1]
	return w
T = int(rr())
for _ in range(T):
	n = int(rr())
	ans = solve(n)
	print(ans)


from sys import stdin, stdout
T = int(stdin.readline())
ans = []
for _ in range(T):
	n = int(stdin.readline())
	s = stdin.readline()
	sa = s[0:n]
	st = ''
	for i in range(1, n):
		s1 = s[i:i + n]
		st = ''
		for j in range(n):
			if sa[j] == 'b':
				st += 'b'
			elif sa[j] == s1[j]:
				st += sa[j]
			else:
				st += 'b'
		sa = st
	st = ''
	for i in range(n):
		if sa[i] == 'b':
			st += '0'
		else:
			st += sa[i]
	ans += [st]
stdout.write('\n'.join(ans))


for _ in range(int(input())):
	n1 = int(input())
	s1 = input()
	l1 = []
	ns = ''
	for i in range(n1):
		l1.append(s1[i:n1 + i])
	for j in range(n1):
		ns += l1[j][j]
	print(ns)


t = int(input())
for _ in range(t):
	n = int(input())
	string = input()
	answer = ''
	for i in range(0, 2 * n - 1, 2):
		answer += string[i]
	print(answer)


num_tc = int(input())

def string(array, size):
	string_ = ''
	for i in range(0, len(array), 2):
		string_ += str(array[i])
	return string_
for i in range(num_tc):
	size = int(input())
	strin = input()
	print(string(strin, size))


import math
import sys
import collections

def In():
	return map(int, sys.stdin.readline().split())
input = sys.stdin.readline

def strsim():
	for i in range(int(input())):
		n = int(input())
		s = input().rstrip()
		ans = ['0'] * n
		used = [False] * n
		pos = 0
		for i in range(n, 2 * n):
			last = i - n
			new = s[last:i]
			for x in range(n):
				if new[x] == ans[x]:
					used[x] = True
					break
				if not used[x]:
					pos = x
			else:
				ans[pos] = new[pos]
				used[pos] = True
		print(*ans, sep='')
strsim()


for t in range(int(input())):
	n = int(input())
	ip = input()
	print(ip[n - 1] * n)


for _ in range(int(input())):
	n = int(input())
	a = input()
	if n == 1:
		print(a)
	else:
		on = '1' * n
		tw = '0' * n
		if tw in a:
			print(tw)
		else:
			print(on)


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	if len(s) <= n:
		print(s)
	else:
		ans = list(s[:n])
		k = 1
		while k < n:
			for j in range(n):
				if ans[j] == '0':
					pass
				elif s[k + j] == '1':
					ans[j] = '1'
				else:
					ans[j] = '0'
			k = k + 1
		s1 = ''
		for j in range(len(ans)):
			s1 = s1 + ans[j]
		print(s1)
	t = t - 1


for t in range(int(input())):
	n = int(input())
	a = str(input())
	A = list(a)
	b = []
	if A[n - 1] == '0':
		for i in range(n):
			b.append('0')
		print(''.join(b))
	else:
		for j in range(n):
			b.append('1')
		print(''.join(b))


import sys
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	s = input()
	ans = ''
	ch = s[n - 1]
	while n > 0:
		n -= 1
		ans += ch
	print(ans)


def similar_str():
	input_data = int(input())
	data_lst = []
	lst = []
	q = 0
	chk1 = []
	chk0 = []
	ans = []
	answer = ''
	for i in range(input_data):
		n = int(input())
		data_lst.append(list(input()))
		r = n
		for i in range(n):
			chk0.append('0')
			chk1.append('1')
		for i in range(len(data_lst)):
			for j in range(len(data_lst[i]) - (n - 1)):
				lst.append(data_lst[i][q:r])
				q += 1
				r += 1
		for i in range(1):
			if chk0 not in lst and chk1 not in lst:
				ans = chk0
			elif chk0 in lst and chk1 not in lst:
				ans = chk0
			elif chk0 not in lst and chk1 in lst:
				ans = chk1
		for i in range(len(ans)):
			answer += ans[i]
		print(answer)
		data_lst = []
		lst = []
		q = 0
		chk1 = []
		chk0 = []
		ans = []
		answer = ''
similar_str()


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	w = []
	for i in range(0, n):
		w.append(s[i])
	j = 1
	for i in range(1, n):
		if s[i] == w[0]:
			continue
		elif j < n:
			w[j] = s[i + j]
			j += 1
	k = ''
	for i in range(0, n):
		k += w[i]
	print(k)


def ans(n, s):
	return s[0::2]
L = []
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	L.append(ans(n, s))
for l in L:
	print(l)


def inp_n():
	return int(input())

def inp_list():
	return list(map(int, input().split()))

def inp_mul_num():
	return map(int, input().split())

def is_odd(n):
	if n & 1:
		return True
	return False
for _ in range(inp_n()):
	n = inp_n()
	s = input()
	ans = ''
	if s[n - 1] == '0':
		ans = '0' * n
	else:
		ans = '1' * n
	print(ans)


t = int(input())
for i in range(t):
	m = []
	n = int(input())
	s = list(input())
	for i in range(n):
		m.append(s[i:n + i])
	for i in range(n):
		print(m[i][i], end='')
	print()


t = int(input())
while t > 0:
	n = int(input())
	l = input()
	s = ''
	i = 0
	while i < len(l):
		s += l[i]
		i += 2
	print(s)
	t -= 1


def tc():
	n = int(input())
	s = input()
	l = len(s)
	w = s[::2]
	print(w)
T = int(input())
for _ in range(T):
	tc()


for _ in range(int(input())):
	n = int(input())
	s = input()
	l = []
	a = s[n - 1]
	str1 = ''
	for i in range(n):
		l.append(a)
	for ele in l:
		str1 += ele
	print(str1)


from sys import stdin, stdout
t = int(stdin.readline())
for case in range(t):
	n = int(stdin.readline())
	s = stdin.readline()
	A = []
	for i in range(n):
		A.append(s[i:i + n])
	res = ['0'] * n
	chk = 0
	for item in A:
		res[chk] = item[chk]
		chk += 1
	stdout.write('{}\n'.format(''.join(res)))


t = int(input())
for _t in range(t):
	n = int(input())
	s = input()
	x = 2 * n - 1
	ans = ''
	for i in range(0, x, 2):
		ans += s[i]
	print(ans)


for i in range(int(input())):
	n = int(input())
	listik = [int(j) for j in input()]
	listochek = [str(listik[i]) for i in range(0, len(listik), 2)]
	print(''.join(listochek))


import sys
import math, bisect
from collections import defaultdict
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, OrderedDict

def neo():
	return map(int, input().split())

def Neo():
	return list(map(int, input().split()))
for _ in range(int(input())):
	n = int(input())
	s = input()
	print(s[0::2])


import sys
for bruh in range(0, int(sys.stdin.readline())):
	leng = sys.stdin.readline()
	sys.stdout.write(sys.stdin.readline()[::2] + '\n')


from sys import stdin
input = lambda : stdin.readline().strip()
for _ in range(int(input())):
	n = int(input())
	s = input()
	sa = ''
	for i in range(0, len(s)):
		if i % 2 == 0:
			sa += s[i]
	print(sa)


import os
import heapq
import sys, threading
import math
import bisect
import operator
from collections import defaultdict
from io import BytesIO, IOBase

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

def power(x, p, m):
	res = 1
	while p:
		if p & 1:
			res = res * x % m
		x = x * x % m
		p >>= 1
	return res

def inar():
	return [int(el) for el in input().split()]

def lcm(num1, num2):
	return num1 * num2 // gcd(num1, num2)

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		st = input()
		ans = ''
		for i in range(len(st)):
			if i % 2 == 0:
				ans += st[i]
		print(ans)
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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


x = int(input())
for i in range(x):
	n = int(input())
	s = input()
	a = s[n - 1] * n
	print(a)


for i in range(int(input())):
	a = int(input())
	b = input()
	ans = [0 for j in range(a)]
	for j in range(a):
		ans[j] = b[2 * j]
	res = ''
	for j in ans:
		res += str(j)
	print(res)


t = int(input())
for _ in range(t):
	(_, s) = (int(input()), input())
	print(''.join(s[::2]))


def stringSimilarity(n, s):
	ans = ''
	for i in range(0, len(s), 2):
		ans += s[i]
	return ans
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	print(stringSimilarity(n, s))


from sys import stdin
for _ in range(int(input())):
	(n, s) = (int(input()), input())
	print(s[n - 1] * n)


import math
from itertools import combinations
from collections import Counter
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	d = Counter(s)
	o = 0
	z = 0
	for i in range(len(s)):
		x = s[i:n]
		if '1' in x:
			o += 1
		if '0' in x:
			z += 1
	if o == n:
		print('1' * n)
	elif z == n:
		print('0' * n)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ans = 0
	temp = 0
	if s[:n - 1]:
		temp = int(s[:n - 1], 2)
	for i in range(n):
		temp *= 2
		temp += int(s[n - 1 + i])
		ans |= temp
		temp %= 1 << n - 1
	print(format(ans, '0' + str(n) + 'b'))


def fun():
	n = int(input())
	s = input()
	str = ''
	for i in range(n):
		str += s[n - 1]
	return str

def solve():
	t = int(input())
	for i in range(t):
		print(fun())
solve()


testCases = int(input())
for _ in range(testCases):
	n = int(input())
	string = input()
	print(string[n - 1] * n)


T = int(input())
for t in range(T):
	N = int(input())
	s = input()
	print(s[N - 1] * N)


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
num = int(z())
for _ in range(num):
	n = int(z())
	l = z()
	ans = ''
	for i in range(0, 2 * n - 1, 2):
		ans += l[i]
	print(ans)


import sys
input = sys.stdin.readline
ins = lambda : input().rstrip()
ini = lambda : int(input().rstrip())
inm = lambda : map(int, input().split())
inl = lambda : list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))
ans = []
t = ini()
for _ in range(t):
	n = ini()
	s = ins()
	ans.append(n * s[(2 * n - 1) // 2])
out(ans)


from sys import stdin
import math
inp = lambda : stdin.readline().strip()
t = int(inp())
for _ in range(t):
	n = int(inp())
	s = list(inp())
	a = []
	cur = 0
	tmp = 2
	for i in range(n):
		a.append(s[cur])
		cur += tmp
	print(''.join(a))


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	s = input()
	ans = ''
	p = 0
	for i in range(0, n):
		sub = s[i:i + n]
		ans += sub[p]
		p += 1
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	if '1' not in s:
		print('0' * n)
	elif '0' not in s:
		print('1' * n)
	else:
		ans = '0' * n
		for j in range(n):
			count = 0
			for k in range(n):
				check = s[j:j + n]
				if check[k] == ans[k]:
					count += 1
			if count == 0:
				ans = ans[1:] + '1'
		print(ans)


for _ in range(int(input())):
	n = int(input())
	s = input()
	k = 0
	ans = ''
	for i in range(n):
		j = s[i:i + n]
		p = 0
		check = 1
		while p < k:
			if ans[p] == j[p]:
				check = 0
				break
			p += 1
		if check == 1:
			ans = ans + j[k]
			k += 1
	print(ans + (n - k) * '0')


import sys
ll = lambda : list(map(int, input().split()))
lls = lambda : list(map(str, input().split()))
fin = lambda : list(map(float, input().split()))
st = lambda : input()
v = lambda : map(int, input().split())
ii = lambda : int(input())
mod = 10 ** 9 + 7
from math import *
from datetime import datetime
from collections import *
import math
for _ in range(ii()):
	x = ii()
	s = st()
	a = len(s) // 2
	print(s[a] * x)


import os
from sys import stdin, stdout

def solve(tc):
	n = int(stdin.readline().strip())
	seq = stdin.readline().strip()
	ans = []
	for i in range(0, 2 * n - 1, 2):
		ans.append(seq[i])
	print(*ans, sep='')
tcs = 1
tcs = int(stdin.readline().strip())
tc = 1
while tc <= tcs:
	solve(tc)
	tc += 1


testCases = int(input())
ans = ''
while testCases > 0:
	n = int(input())
	s = input()
	if n == 1:
		print(s[0])
		testCases -= 1
		continue
	if s[n - 1] == '0':
		ans = '0' * n
	else:
		ans = '1' * n
	print(ans)
	testCases -= 1


for cases in range(int(input())):
	n = int(input())
	s = input()
	s1 = ''
	count = 0
	for i in range(0, n):
		s1 += s[count]
		count += 2
	print(s1)


import sys, bisect, string, math, time, functools, random, fractions
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
from itertools import permutations, combinations, groupby
rep = range
R = range

def Golf():
	(n, *t) = map(int, open(0).read().split())

def I():
	return int(input())

def S_():
	return input()

def IS():
	return input().split()

def LS():
	return [i for i in input().split()]

def MI():
	return map(int, input().split())

def LI():
	return [int(i) for i in input().split()]

def LI_():
	return [int(i) - 1 for i in input().split()]

def NI(n):
	return [int(input()) for i in range(n)]

def NI_(n):
	return [int(input()) - 1 for i in range(n)]

def StoLI():
	return [ord(i) - 97 for i in input()]

def ItoS(n):
	return chr(n + 97)

def LtoS(ls):
	return ''.join([chr(i + 97) for i in ls])

def RA():
	return map(int, open(0).read().split())

def RLI(n=8, a=1, b=10):
	return [random.randint(a, b) for i in range(n)]

def RI(a=1, b=10):
	return random.randint(a, b)

def Rtest(T):
	(case, err) = (0, 0)
	for i in range(T):
		inp = INP()
		(a1, ls) = naive(*inp)
		a2 = solve(*inp)
		if a1 != a2:
			print((a1, a2), inp)
			err += 1
		case += 1
	print('Tested', case, 'case with', err, 'errors')

def GI(V, E, ls=None, Directed=False, index=1):
	org_inp = []
	g = [[] for i in range(V)]
	FromStdin = True if ls == None else False
	for i in range(E):
		if FromStdin:
			inp = LI()
			org_inp.append(inp)
		else:
			inp = ls[i]
		if len(inp) == 2:
			(a, b) = inp
			c = 1
		else:
			(a, b, c) = inp
		if index == 1:
			a -= 1
			b -= 1
		aa = (a, c)
		bb = (b, c)
		g[a].append(bb)
		if not Directed:
			g[b].append(aa)
	return (g, org_inp)

def GGI(h, w, search=None, replacement_of_found='.', mp_def={'#': 1, '.': 0}, boundary=1):
	mp = [boundary] * (w + 2)
	found = {}
	for i in R(h):
		s = input()
		for char in search:
			if char in s:
				found[char] = (i + 1) * (w + 2) + s.index(char) + 1
				mp_def[char] = mp_def[replacement_of_found]
		mp += [boundary] + [mp_def[j] for j in s] + [boundary]
	mp += [boundary] * (w + 2)
	return (h + 2, w + 2, mp, found)

def TI(n):
	return GI(n, n - 1)

def accum(ls):
	rt = [0]
	for i in ls:
		rt += [rt[-1] + i]
	return rt

def bit_combination(n, base=2):
	rt = []
	for tb in R(base ** n):
		s = [tb // base ** bt % base for bt in R(n)]
		rt += [s]
	return rt

def gcd(x, y):
	if y == 0:
		return x
	if x % y == 0:
		return y
	while x % y != 0:
		(x, y) = (y, x % y)
	return y

def YN(x):
	print(['NO', 'YES'][x])

def Yn(x):
	print(['No', 'Yes'][x])

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
mo = 10 ** 9 + 7
inf = float('inf')
FourNb = [(-1, 0), (1, 0), (0, 1), (0, -1)]
EightNb = [(-1, 0), (1, 0), (0, 1), (0, -1), (1, 1), (-1, -1), (1, -1), (-1, 1)]
compas = dict(zip('WENS', FourNb))
cursol = dict(zip('LRUD', FourNb))
l_alp = string.ascii_lowercase
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
input = lambda : sys.stdin.readline().rstrip()
show_flg = False
show_flg = True
ans = 0
for _ in range(I()):
	n = I()
	s = input()
	ans = s[0::2]
	print(ans)


import sys

def inputt():
	return sys.stdin.readline().strip()

def printt(n):
	sys.stdout.write(str(n) + '\n')

def listt():
	return [int(i) for i in inputt().split()]
t = int(inputt())
for _ in range(t):
	n = int(inputt())
	s = inputt()
	g = s[n - 1]
	h = n * g
	printt(h)


repetitions = int(input())
while repetitions > 0:
	n = int(input())
	returnable = ''
	sequence = list(map(str, input()))
	lastIndex = n - 1
	for i in range(0, len(sequence) - n + 1, 1):
		subString = sequence[i:lastIndex + 1]
		lastIndex += 1
		returnable += subString[i]
	repetitions -= 1
	print(returnable)


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		s = input()
		if n == 1:
			print(s)
		else:
			p = s[0]
			p += s[n - 1] * (n - 2)
			p += s[-1]
			print(p)
main()


import itertools

def check(num1, num2):
	for (i, j) in zip(num1, num2):
		if i == j:
			return True
	return False
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ss = set()
	for i in range(n):
		ss.add(s[i:i + n])
	for nn in itertools.product('01', repeat=n):
		n2 = ''.join(nn)
		for num in ss:
			if check(n2, num):
				continue
			break
		else:
			print(n2)
			break


t = int(input())
for case in range(t):
	n = int(input())
	s = input()
	ans = ''
	for i in range(n):
		ans += s[2 * i]
	print(ans)


TC = int(input())
while TC > 0:
	len = int(input())
	n = input()
	print(n[::2])
	TC -= 1


t = int(input())
for i in range(t):
	l = int(input())
	s = input()
	n = ''
	j = 0
	k = 0
	while len(n) != l:
		c = s[j:j + l]
		n += c[k]
		j += 1
		k += 1
	print(n)


def str_similarity(n, s):
	if set(s) == {'0'}:
		x = n * '0'
		return x
	if set(s) == {'1'}:
		x = n * '1'
		return x
	ans = ''
	j = 0
	for i in range(n):
		k = s[i:n + i]
		ans += k[j]
		j += 1
	return ans
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	print(str_similarity(n, s))


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	ans = ''
	k = s[(2 * n - 1) // 2]
	for j in range(n):
		ans = ans + k
	print(ans)


import math
from collections import deque
import sys
sys.setrecursionlimit(10 ** 4)

def Divisors(n):
	l = []
	i = 2
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
		i = i + 1
	return l

def SieveOfEratosthenes(n):
	l = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			l.append(p)
	return l

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(n)
	return l

def Factors(n):
	result = []
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			if i == n / i:
				result.append(i)
			else:
				result.append(i)
				result.append(n // i)
	result.append(1)
	return result

def maxSubArraySum(a):
	max_so_far = 0
	max_ending_here = 0
	size = len(a)
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < abs(max_ending_here):
			max_so_far = max_ending_here
	return max_so_far

def longestsubarray(arr, n, k):
	current_count = 0
	max_count = 0
	for i in range(0, n, 1):
		if arr[i] % k != 0:
			current_count += 1
		else:
			current_count = 0
		max_count = max(current_count, max_count)
	return max_count

def main():
	n = int(input())
	s = input()
	s1 = ''
	for i in range(0, len(s), 2):
		s1 += s[i]
	print(s1)
t = int(input())
for i in range(0, t):
	main()


t = int(input())
for qwe in range(t):
	n = int(input())
	s = input()
	ans = ''
	k = 0
	for i in range(n):
		ans += s[i + k]
		k += 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	string = input()
	print(string[len(string) // 2] * n)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	if len(s) == 1:
		print(s)
	elif all((s[i] == s[i + 1] for i in range(len(s) - 1))):
		print(s[0] * n)
	else:
		c = '0' * n
		c1 = list(c)
		s1 = list(s)
		for i in range(n):
			d = s1[i:i + n]
			found = 0
			for j in range(len(c)):
				if c1[j] == d[j]:
					found = 1
					break
			if found == 0:
				c1[i] = d[i]
		print(''.join(c1))


import math
import sys

def dict_sort(ans):
	ans = sorted(ans.items(), reverse=True, key=lambda kv: kv[1])

def is_prime(n):
	if n == 1:
		return 0
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def seive_primes(n):
	flag = [0] * (n + 10)
	flag[1] = flag[0] = 1
	i = 2
	while i * i <= n + 1:
		if flag[i] == 0:
			j = i * i
			while j <= n + 1:
				flag[j] = 1
				j += i
		i += 1
	return flag

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def alphabates():
	return 'abcdefghijklmnopqrstuvwxyz'

def binary_search(ls, n, flag):
	low = 0
	hi = n - 1
	while low <= hi:
		mid = (low + hi) // 2
		if ls[mid] == flag:
			return mid
		elif ls[mid] > flag:
			hi = mid - 1
		else:
			low = mid + 1
	return -1

def Binary(n):
	if n == 0:
		return '00000000'
	binary = ''
	i = 0
	while n > 0 and i <= 8:
		s1 = str(int(n % 2))
		binary = binary + s1
		n /= 2
		i = i + 1
		d = binary[::-1]
	return d

def qdrt(x, a, b, c):
	return a * x * x + b * x + c

def inp():
	ls = list(map(int, input().split()))
	return ls

def mult_inp():
	return map(int, input().split())

def knapSack(W, wt, val, n):
	K = [[0 for x in range(W + 1)] for x in range(n + 1)]
	for i in range(n + 1):
		for w in range(W + 1):
			if i == 0 or w == 0:
				K[i][w] = 0
			elif wt[i - 1] <= w:
				K[i][w] = max(val[i - 1] + K[i - 1][w - wt[i - 1]], K[i - 1][w])
			else:
				K[i][w] = K[i - 1][w]
	return K[n][W]
for _ in range(int(input())):
	n = int(input())
	s = input()
	ans = ''
	i = 0
	while i < 2 * n - 1:
		if i % 2 == 0:
			ans += s[i]
		i += 1
	print(ans)


for _ in range(0, int(input())):
	a = int(input())
	b = input()
	print(b[len(b) // 2] * a)


t = int(input())
for i in range(t):
	n = int(input())
	s = str(input())
	ans = ''
	i = 0
	for j in range(0, n):
		a = s[j:j + n]
		ans += a[i]
		i += 1
	print(ans)


try:
	for _ in range(int(input())):
		n = int(input())
		s = input()
		print(s[n - 1] * n)
except:
	pass


t = int(input())
for k in range(t):
	n = int(input())
	s = input()
	ans = ''
	for p in range(n):
		ans += s[2 * p]
	print(ans)


import sys

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math
from collections import defaultdict
for _ in range(ri()):
	n = ri()
	s = rs()
	st = ''
	i = 0
	while i < 2 * n - 1:
		st += s[i]
		i += 2
	print(st)


from sys import stdin

def iinput():
	return int(stdin.readline())

def minput():
	return map(int, stdin.readline().split())

def linput():
	return list(map(int, stdin.readline().split()))
t = iinput()
while t:
	t -= 1
	n = iinput()
	s = input()
	print(s[::2])


t = int(input())
for g in range(t):
	n = int(input())
	s = list(input())
	w = ''
	for i in range(0, 2 * n - 1, 2):
		w += s[i]
	print(w)


def read_ints():
	return list(map(int, input().split()))

def read_int():
	return int(input())

def main():
	t = read_int()
	for _ in range(t):
		n = read_int()
		s = list(input())
		arr = []
		for i in range(n):
			cur = []
			for j in range(n):
				cur.append(s[i + j])
			arr.append(cur)
		answer = ''
		for i in range(n):
			answer += arr[i][i]
		print(answer)
main()


for _ in range(int(input())):
	n = int(input())
	s = str(input())
	ans = ''
	i = 0
	while i < len(s):
		ans += s[i]
		i += 2
	print(ans)


from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
from collections import Counter
from math import sqrt
import collections
import math
import heapq
import re

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def most_frequent(list):
	return max(set(list), key=list.count)

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def Convert(string):
	li = list(string.split(''))
	return li

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
prime = []
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j

def main():
	for _ in range(int(input())):
		n = inin()
		s = sin()
		if n == 1:
			print(s)
			continue
		for i in range(n):
			print(s[n - 1], end='')
		print('')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	n = int(input())
	s = input()
	l = len(s)
	ans = ''
	for i in range(0, l, 2):
		ans += s[i]
	print(ans)


n = int(input())
for i in range(n):
	m = int(input())
	a = input()
	a.split()
	a = list(a)
	b = []
	c = m
	if m == 1:
		print(a[0])
	else:
		for i in range(m):
			d = m - c
			c -= 1
			x = i + d
			b.append(a[x])
		ch = ''
		b = ch.join(b)
		print(b)


def main(n, s):
	ans = ''
	for i in range(n):
		idx = 2 * i
		ans += s[idx]
	print(ans)
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	main(n, s)


test_case = int(input())
for i in range(test_case):
	n = int(input())
	arr = list(input())
	arr = list(map(int, arr))
	x = arr.count(1)
	y = arr.count(0)
	if 2 * n - 1 == x:
		l = ['1'] * n
	elif 2 * n - 1 == y:
		l = ['0'] * n
	elif x > y:
		l = ['1'] * n
	else:
		l = ['0'] * n
	s = ''.join(l)
	print(s)


T = int(input())
for t in range(T):
	n = int(input())
	s = input()
	if n == 1:
		print(s)
		continue
	c = 0
	for i in range(2 * n - 1):
		if s[i] == '1':
			c += 1
	if c == 2 * n - 1:
		while n:
			print('1', end='')
			n -= 1
		print()
		continue
	if c == 0:
		while n:
			print('0', end='')
			n -= 1
		print()
		continue
	i = 0
	while i < 2 * n:
		print(s[i], end='')
		i += 2
	print()


for _ in range(int(input())):
	n = int(input())
	s = input()
	w = []
	for i in range(n):
		x = s[i:i + n]
		w.append(x[i])
	w = ''.join((x for x in w))
	print(w)


from sys import stdin
for _ in range(int(input())):
	n = int(input())
	s = stdin.readline().rstrip()
	w = ''
	for i in range(n):
		if w == '':
			w += s[i]
		elif w[0] != s[i]:
			w += s[i + len(w)]
	if len(w) < n:
		w += '0' * (n - len(w))
	print(w)


import math
import collections
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect_left as bsl
from bisect import bisect_right as bsr
import heapq as hq
setrecursionlimit(2 ** 20)
t = 1
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	s = stdin.readline().strip('\n')
	ans = ''
	for i in range(1, n + 1):
		ans += s[2 * i - 1 - 1]
	print(ans)


T = int(input())
for _ in range(T):
	a = int(input())
	x = input()
	char = x[a - 1]
	print(a * char)


def solve():
	n = int(input())
	s = input()
	if n == 1:
		if len(set(list(s))) == 1:
			print(s[0])
			return
	ans = 0
	for i in range(len(s) - n + 1):
		ans |= int(s[i:i + n], 2)
	if len(bin(ans)[2:]) < n:
		print('0' * (n - len(bin(ans)[2:])) + bin(ans)[2:])
	else:
		print(bin(ans)[2:])
for _ in range(int(input())):
	solve()


tests = int(input())
results = []
for _x in range(tests):
	n = int(input())
	x = input()
	c = x[n - 1]
	results.append(c * n)
print(*results, sep='\n')


times = int(input())
for i in range(times):
	length = int(input())
	s = input()
	answer = s[0]
	index = 2
	while length > 1:
		answer += s[index]
		length -= 1
		index += 2
	print(answer)


def sxor(s1, s2):
	return ''.join((str(ord(a) ^ ord(b)) for (a, b) in zip(s1, s2)))

def getSimyStr(num_str, n):
	if n == 1:
		print(num_str)
		return
	ans = list(num_str[0:n])
	for i in range(n):
		match_str = sxor(ans, num_str[i:i + n])
		if not match_str.count('0'):
			ans[i] = chr(ord('a') - ord(ans[i]))
	print(''.join(ans))
t = int(input())
for _ in range(t):
	n = int(input())
	num_str = input().rstrip()
	getSimyStr(num_str, n)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	x = s.count('0')
	y = s.count('1')
	sam = ''
	counter = 0
	if n == 1:
		print(s)
	else:
		for i in range(n):
			sam += s[i:][counter]
			counter += 1
		print(sam)


from sys import stdout

def function(input):
	n = (len(input) + 1) // 2
	return input[n - 1] * n
total = int(input())
for index in range(2 * total):
	line = input()
	if index % 2 == 0:
		pass
	else:
		result = function(line)
		print(result)
	stdout.flush()


ct = input()
for line in range(int(ct)):
	n = int(input())
	s = input()
	arr = []
	for i in range(len(s) - (n - 1)):
		arr.append(s[i:i + n])
	final = []
	for i in range(len(arr)):
		final.append(arr[i][i])
	print(''.join(final))


def checker(n, s):
	t = ''
	for i in range(0, 2 * n, 2):
		t += s[i]
	return t
for _ in range(int(input())):
	m = int(input())
	w = input()
	print(checker(m, w))


for _ in range(int(input())):
	n = int(input())
	strr = list(input())
	nth = strr[n - 1]
	ans = nth * n
	print(ans)


t = int(input())
for _ in range(t):
	ans = ''
	n = int(input())
	s = input()
	d = 0
	for i in range(n):
		ans += s[i + d]
		d += 1
	print(ans)


for t in range(int(input())):
	n = int(input())
	s = input()
	visit = [0 for i in range(n)]
	a = []
	for i in range(n):
		b = []
		for j in range(i, n + i):
			b.append(int(s[j]))
		a.append(b)
	for i in range(n):
		(add, count) = (0, 0)
		for j in range(n):
			if a[j][i] == 0:
				add += 1
			else:
				count += 1
		if add == n:
			visit[i] = 0
		elif count == n:
			visit[i] = 1
	for i in visit:
		print(i, end='')
	print()


for _ in range(int(input())):
	n = int(input())
	s = list(str(input()))
	w = []
	for i in range(0, 2 * n, 2):
		w.append(s[i])
	print(''.join(map(str, w)))


import sys

def solve(N, inbits):
	outbits = [inbits[0] for _ in range(N)]
	curr_limit = 1
	for start in range(N):
		if any((a == b for (a, b) in zip(inbits[start:start + curr_limit], outbits))):
			continue
		outbits[curr_limit] = inbits[start + curr_limit]
		curr_limit += 1
	return ''.join(outbits)

def main():
	test_cases = int(sys.stdin.readline())
	for _ in range(test_cases):
		N = int(sys.stdin.readline())
		inbits = [c for c in sys.stdin.readline().strip()]
		print(solve(N, inbits))
main()


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	str = input()
	ans = ''
	for i in range(0, n):
		ans += str[2 * i]
	print(ans)


t = int(input())
i = 0
while i < t:
	n = int(input())
	number = str(input())
	index = 0
	answer = ''
	while index < 2 * n - 1:
		answer += str(number[index])
		index += 2
	print(answer)
	i += 1


import sys
import math

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	n = int(input())
	s = input()
	ans = []
	for i in range(0, 2 * n, 2):
		ans.append(s[i])
	print(''.join(ans))


from sys import stdin, stdout
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	s = input().strip()
	ans = []
	for i in range(n):
		ans += [int(s[i:n + i], 2)]
	t = '1' * n
	tn = int(t, 2)
	for a in ans:
		if not tn & a:
			break
	else:
		print(t)
		continue
	t = []
	for i in range(n):
		if i % 2:
			t.append('1')
		else:
			t.append('0')
	t = ''.join(t)
	tn = int(t, 2)
	for a in ans:
		if not tn & a:
			break
	else:
		print(t)
		continue
	t = []
	for i in range(n):
		if i % 2:
			t.append('0')
		else:
			t.append('1')
	t = ''.join(t)
	tn = int(t, 2)
	for a in ans:
		if not tn & a:
			break
	else:
		print(t)
		continue
	print('0' * n)


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ss = []
	for i in range(n):
		ss.append(s[i:i + n])
	ans = ''
	for i in range(n):
		p = ss[0][i]
		is_equal = True
		for j in range(n):
			if ss[j][i] != p:
				is_equal = False
				break
		if is_equal:
			ans += p
		else:
			ans += '1'
	print(ans)


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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
for _ in range(int(ri())):
	n = int(ri())
	s = ri()
	ans = []
	for i in range(0, len(s), 2):
		ans.append(s[i])
	print(''.join(ans))


T = int(input())
for _ in range(T):
	n = int(input())
	s = input()
	print(s[::2])


import math
test_cases = int(input())
for test_case in range(test_cases):
	n = int(input())
	s = input()
	x = s[n - 1]
	ans = x * n
	print(ans)


test_cases = int(input())
for test_no in range(test_cases):
	length_of_substr = int(input())
	sub_str = input()
	value_at_nth_pos = sub_str[length_of_substr - 1]
	similar_binary_str = value_at_nth_pos * length_of_substr
	print(similar_binary_str)


import sys, math
input = sys.stdin.readline
t = int(input())
for r in range(t):
	n = int(input())
	s = input().strip('\n')
	ans = ''
	count = 0
	for i in range(n):
		ans += s[i + count]
		count += 1
	print(ans)


def sol(s, n):
	p = ''
	x = ''
	diff = ''
	for i in range(0, len(s) - n + 1):
		x = s[i:i + n]
		if '0' in x:
			diff += '0'
		else:
			diff += '1'
	print(diff)
k = int(input())
for i in range(k):
	n = int(input())
	s = input()
	sol(s, n)


import sys
tc = int(sys.stdin.readline())
for _ in range(tc):
	n = int(sys.stdin.readline())
	arr = sys.stdin.readline().rstrip()
	temp = []
	for i in range(n):
		temp.append(arr[i:i + n])
	idx = 0
	ans = [0] * n
	for i in range(len(temp)):
		ans[i] = temp[i][i]
	print(''.join(map(str, ans)))