#include <bits/stdc++.h>
using namespace std;
int solve() {
  long long i, j, u, v, k, n, ans;
  cin >> n;
  string s;
  cin >> s;
  string w(n, s[n - 1]);
  cout << w;
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
