#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    char d = s[n - 1];
    for (int i = 0; i < n; ++i) cout << d;
    cout << endl;
  }
  return 0;
}
