[白俊]P 2675


import java.util.Scanner;

public class P2675 {

	public static void main(String[] args) {

		int test;
		String[] arr;
		int[] num;

		Scanner sc = new Scanner(System.in);

		test = sc.nextInt();

		num = new int[test];
		arr = new String[test];

		for (int i = 0; i < test; i++) {

			num[i] = sc.nextInt();
			arr[i] = sc.next();

		}

		int n;
		String s;
		for (int k = 0; k < test; k++) {

			n = num[k];
			s = arr[k];

			for (int i = 0; i < s.length(); i++) {

				for (int j = 0; j < n; j++) {

					System.out.print(s.charAt(i));
				}

			}
			System.out.println();

		}

		sc.close();

	}

}