样例
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 200010;
int n;
char str[N];
int main()
{
int T;
scanf("%d", &T);
while (T -- )
{
scanf("%d", &n);
scanf("%s", str);
for (int i = 0; i < n; i ++ )
if (i == n - 1)
{
str[i] = 0;
puts(str);
break;
}
else if (str[i] > str[i + 1])
{
str[i] = 0;
printf("%s%s\n", str, str + i + 1);
break;
}
}
return 0;
}