#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, h, t, p;
  cin >> h;
  while (h--) {
    cin >> n;
    string a;
    cin >> a;
    if (n == 1) {
      cout << a << "\n";
      continue;
    }
    vector<int> ans(n);
    int k = n - 1;
    for (int i = 2 * n - 2; i >= 0; i -= 2) ans[k--] = (a[i] == '1');
    for (int i = 0; i < n; i++) cout << ans[i];
    cout << "\n";
  }
}
