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