#include <bits/stdc++.h>
int main() {
  int t, n, s;
  char similar;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    s = (2 * n - 1);
    char string[s + 1];
    scanf("%s", string);
    char rows[n][n];
    int i;
    for (i = 0; i < n; i++) {
      int k = n, j = i, aux = 0;
      while (k--) {
        rows[i][aux] = string[j];
        j++;
        aux++;
      }
    }
    char result[n + 1];
    for (int k = 0; k < n; k++) {
      printf("%c", rows[k][k]);
    }
    printf("\n");
    result[i - 1] = similar;
    result[n] = '\0';
  }
  return 0;
}
