#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  int tc;
  cin >> tc;
  for (int i = 0; i < tc; i++) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    string p;
    int k = 0, m = n - 1;
    while (m < s.length()) {
      string h = s.substr(k, n);
      p += h[k];
      k++;
      m++;
    }
    cout << p << endl;
  }
}
