#include <bits/stdc++.h>
using namespace std;
string make(string str,char a)
{
    string st = str;
    int l = st.length();
    char c = st[l - 1];
    st[l - 1] = a;
    st += c;
    return st;
}
bool operator< (string a, string b)
{
    for (int i = 0; i < a.length();i++)
    {
        if (a[i] < b[i]) return true;
        if (a[i] > b[i]) return false;
    }
    return false;
}
int n, k;
char get(char a)
{
    if (a == 'a' + k - 1 || a == 'a') return 'a';
    else return (char)(a-1);
}
string dp[505][2];
int main()
{
    ios::sync_with_stdio(false);
    int T;
    cin >> T;
    for (;T--;)
    {

        cin >> n >> k;
        string str;
        cin >> str;
        dp[0][0] = "";
        if (str[0] == 'a' + k - 1 || str[0] == 'a') dp[0][0] = "a";
        else dp[0][0] = str[0] - 1;
        dp[0][1] = "";
        for (int i = 1; i < n; i++) 
        {
            string st;
            dp[i][0] = dp[i - 1][0] + get(str[i]);
            dp[i][1] = dp[i - 1][0];
            st = dp[i - 1][1] + get(str[i]) + str[i - 1];
            if (st < dp[i][0]) dp[i][0] = st;
            st = make(dp[i - 1][0],str[i]);
            if (st < dp[i][0]) dp[i][0] = st;
            if (i > 1)
            {
              st = make(dp[i - 2][0],str[i]);
              st += str[i - 1]; 
              if (st < dp[i][0]) dp[i][0] = st;
            }
        }
        cout << dp[n - 1][0] << endl;
    }
}