#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  string s;
  cin >> n >> s;
  for (long long int i = 0; i < n; i++) cout << s[n - 1];
  cout << endl;
}
int main() {
  int test;
  cin >> test;
  for (int TEST = 1; TEST <= test; TEST++) solve();
}
