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