#include <bits/stdc++.h>
using namespace std;
char e = '\n';
const long long MOD = 1e9 + 7;
long long i, j, le;
int sv(int x) {
  int n = 200000;
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  if (prime[x])
    return 1;
  else
    return 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long n, c = 0;
    string s;
    cin >> n >> s;
    string nst = "";
    if (s.size() == 1)
      cout << s << e;
    else {
      for (i = 0; i + n <= s.size(); i++) {
        string st = s.substr(i, n);
        nst += st[c];
        c++;
      }
      cout << nst << e;
    }
  }
  return 0;
}
