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