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