#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  cout << string(n, s[n - 1]) << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int tt;
  cin >> tt;
  while (tt--) solve();
  return 0;
}
