#include<bits/stdc++.h>
using namespace std;
const int maxn = 500 + 5;
int T, n, k;
string dp[2];
char str[maxn];
int cur = 0;
char idx(char ch)
{
    int id = ch - 'a';
    if (id + 1 == k || id == 0) return 'a';
    return ch - 1;
}
int main()
{
    scanf("%d", &T);
    while (T--) {
        scanf("%d%d", &n, &k);
        scanf("%s", str + 1);
        cur = 0;
        dp[0].clear(); dp[1].clear();
        for (int i = 1; i <= n; ++i) {
            string now;
            int sz = dp[cur].size();
            for (int j = min(3, sz); j >= 1; --j) {
                now.push_back(dp[cur][sz - j]);
            }
            //修改当前字母
            string best = now;
            best.push_back(idx(str[i]));

            if (i > 1) {
                //向左交换一次
                char c = now.back(); now.pop_back();
                now.push_back(str[i]);
                now.push_back(c);
                if (now < best) best = now;

                //i - 1向右交换一次，并且第i次更新值
                now.clear();
                sz = dp[cur^1].size();
                for (int j = min(2, sz); j >= 1; --j) {
                    now.push_back(dp[cur^1][sz - j]);
                }
                now.push_back(idx(str[i]));
                now.push_back(str[i - 1]);
                if (now < best) best = now;

                //i - 1向右交换一次，并且第i次向左交换一次
                if (i > 2) {
                    now.clear();
                    sz = dp[cur^1].size();
                    for (int j = min(2, sz); j >= 1; --j) {
                        now.push_back(dp[cur^1][sz - j]);
                    }
                    c = now.back(); now.pop_back();
                    now.push_back(str[i]);
                    now.push_back(c);
                    now.push_back(str[i - 1]);
                    if (now < best) best = now;
                }
            }
            if (dp[cur^=1].size()) dp[cur].pop_back();
            if (dp[cur].size()) dp[cur].pop_back();
            dp[cur] += best;
        }
        cout << dp[cur] << endl;
    }
}