#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  int n;
  cin >> n;
  cin >> s;
  vector<char> v(n, '3');
  int jod = 0;
  for (int i = n - 1; i <= 2 * n - 2; i++) {
    int cnt = 0;
    for (int j = n - 1; j >= 0; j--, cnt++) {
      if (v[j] == '3') {
        v[j] = s[i - cnt];
        break;
      }
      if (v[j] == s[i - cnt]) break;
    }
  }
  for (int i = 0; i < v.size(); i++)
    if (v[i] == '3')
      cout << 1;
    else
      cout << v[i];
  cout << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
