• Source
    1. import java.io.*;
    2. import java.util.*;
    3.  
    4. class Solution
    5. {
    6. public static void main(String args[]) throws Exception
    7. {
    8. BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
    9. BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    10. int T = Integer.parseInt(br.readLine());
    11. for(int case_t=1;case_t<=T;case_t++)
    12. {
    13. int N = Integer.parseInt(br.readLine());
    14. String[] F = new String[N];
    15. for(int i=1;i<N;i++)
    16. {
    17. F[i] = br.readLine();
    18. }
    19. for(int i=1;i<N;i++)
    20. {
    21. bw.write(F[i].charAt(3));
    22. }
    23. }
    24. bw.flush();
    25. bw.close();
    26. br.close();
    27. }
    28.  
    29. }