import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc   = new Scanner(System.in);
        int t  = sc.nextInt();
        sc.nextLine();
        for(int i = 0;i<t;i++){
            int n  = sc.nextInt();
            sc.nextLine();
            String s  = sc.nextLine();
            String result  = reverseString(s);
            System.out.println(result);
        }
        sc.close();
    }
    public static String reverseString(String s){
        String nospace = s.replaceAll(" ","");
        StringBuilder sb  = new StringBuilder(nospace);
        return sb.reverse().toString();
    }
}