#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string ans;
  for (int i = 0; i < n; ++i) {
    int ok = 0;
    for (int j = 0; j < ans.size(); ++j) {
      if (ans[j] == s[i + j]) {
        ok = 1;
        break;
      }
    }
    if (!ok) ans += (s[i + ans.size()]);
  }
  while (ans.size() != n) {
    ans += '0';
  }
  cout << ans << "\n";
}
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    solve();
  }
  return 0;
}
