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