#include #include #include #include #include #include #include #include //#include #define ll long long #define ull unsigned long long #define ui unsigned int #define d double //#define ld long double using namespace std; const int maxn=1000233,inf=1002333333; bitset<1001>f[501]; int mp[26][26][26]; int i,j,k,n,m; char s[1013],S[505]; int ra,fh;char rx; inline int read(){ rx=getchar(),ra=0,fh=1; while((rx<'0'||rx>'9')&&rx!='-')rx=getchar(); if(rx=='-')fh=-1,rx=getchar(); while(rx>='0'&&rx<='9')ra=ra*10+rx-48,rx=getchar();return ra*fh; } inline int abs(int x){return x<0?-x:x;} int main(){ for(i=0;i<26;i++)for(j=0;j<26;j++)for(k=0;k<26;k++)mp[i][j][k]=(i!=k)+(j!=k); for(int T=read();T;T--){ n=read(),m=read(); scanf("%s",s+1);int n2=n/2,c1,c2; f[n2+1].reset(),f[n2+1][0]=1; for(i=n2;i;i--){ f[i].reset(),c1=s[i]-'a',c2=s[i+n2]-'a'; //for(j=0;j<26;j++)f[i]|=f[i+1]<=0&&f[i+1][k]) {putchar(j+'a'),S[i]=j+'a',rest=k;break;} } for(i=1;i<=n2;i++)putchar(S[i]);puts(""); } }