#include <iostream>
#include <string>
using namespace std;
int main(void)
{
int t;
cin >> t;
for(int j = 0; j < t; j++)
{
int n;
string arr;
cin >> n >> arr;
cout << j + 1 << " ";
for (int i = 0; i < arr.length(); i++)
{
if (n == i + 1) continue;
cout << arr[i];
}
cout << endl;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKHZvaWQpCnsKCWludCB0OwoJY2luID4+IHQ7CgoJZm9yKGludCBqID0gMDsgaiA8IHQ7IGorKykKCXsKCQlpbnQgbjsKCQlzdHJpbmcgYXJyOwoJCWNpbiA+PiBuID4+IGFycjsKCQljb3V0IDw8IGogKyAxIDw8ICIgIjsKCQlmb3IgKGludCBpID0gMDsgaSA8IGFyci5sZW5ndGgoKTsgaSsrKQoJCXsKCQkJaWYgKG4gPT0gaSArIDEpIGNvbnRpbnVlOwoJCQljb3V0IDw8IGFycltpXTsKCQl9CgkJY291dCA8PCBlbmRsOwoJfQp9