#include <bits/stdc++.h>
using namespace std;
const long long int mod = 998244353ll;
const long long int P = 1000000007ll;
const long long int N = 300005ll;
bool cmp(char x, char y) { return x > y; }
void solve() {
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  string t(n, s[n - 1]);
  cout << t;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  cin >> t;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
