#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000005 #define Inf64 1000000000000000001LL int main(){ int _t; cin>>_t; rep(_,_t){ int K; cin>>K; string S; cin>>S; K = min(K, (int)S.size()); string ans = string(K,S[0]) + S; ans = ans.substr(0, S.size()); cout<