#include <algorithm>
#include <iostream>
#include <vector>

#define ll long long
using namespace std;

static bool MULTIPLE_CASES = true;
static long long MOD = (long long) 1e9 + 7;

void insist(bool b) { if (!b) abort(); }

int n, k;

char improveLetter(char letter) {
    if (letter == k-1 + 'a') return 'a';
    if (letter == 'a') return 'a';
    return (char) (letter-1);
}

// 0: individual letter improvement
// 1: swap left
// 2: swap right
string performOperation(string copy, int index, int type) {
    if (type == 0) {
        copy[index] = improveLetter(copy[index]);
    } else if (type == 1) {
        swap(copy[index], copy[index-1]);
    } else if (type == 2) {
        swap(copy[index], copy[index+1]);
    } else insist(false);
    return copy;
}

void solve() {
    cin >> n >> k;

    string s;
    cin >> s;

    // dp[i] = best result of i operations s.t. the next operation is on the ith char in position i.
    vector<string> dp(n+1);
    dp[0] = s;
    dp[1] = performOperation(s, 0, 0);
    string best = dp[1];
    for (int i = 2; i <= n; i++) {
        vector<string> options;
        options.push_back(performOperation(dp[i-1], i-1, 0));
        options.push_back(performOperation(dp[i-1], i-1, 1));
        string type2 = performOperation(dp[i-2], i-2, 2);
        options.push_back(performOperation(type2, i-2, 0));
        if (i > 2) options.push_back(performOperation(type2, i-2, 1));

        sort(options.begin(), options.end());
        dp[i] = options[0];
        if (options[0] < best) best = options[0];
    }
    cout << best << '\n';
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    if (MULTIPLE_CASES) {
        int tests;
        cin >> tests;
        while (tests--) solve();
    } else {
        solve();
    }
}
