#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int main()
{
int n;
scanf("%d", &n);
while (n -- )
{
int a;
char c;
cin >> a >> c;
while (a -- )
{
cout << c;
}
puts("");
}
return 0;
}