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