#include <bits/stdc++.h>
using namespace std;
void Thai_Jase() {
  int n;
  cin >> n;
  string s, w;
  cin >> s;
  for (int i = 0; i < n; i++) {
    w += s[n - 1];
  }
  cout << w << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int ts;
  cin >> ts;
  while (ts--) {
    Thai_Jase();
  }
  return 0;
}
