12
12 3
zazasqzqsasq
1 1
z
1 1
a
15 4
abccbaabccbazaa
16 8
cadjfdsljfdkljds
6 2
baazaa
6 3
bosszb
6 1
qwerty
7 7
daaaaaa
14 2
acabcbdeffewzd
18 6
zzzzzzzzzzzzyyyyyz
9 4
aabaabbbc

zazasqzqsasq
z
a
-1
cbbbbbbbbccccccc
baazbz
bpbbpp
qwerty
ddddddd
acabcbdeffexdx
zzzzzzzzzzzzzzzzzz
-1

#include <bits/stdc++.h>
template <class T1, class T2, class T3>
T1 ksm(T1 a, T2 b, T3 mod) {
  T1 ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return ans;
}
const double pi = acos(-1.);
const int def = 100010;
const int mod = 1000000007;
using namespace std;
int num[26], n, m;
bool check(const string &s) {
  for (auto c : s) num[c - 'a']++;
  for (int i = 0; i < 26; i++)
    if (num[i] % m) return false;
  return true;
}
int main() {
  int _ = 1, __ = 1;
  string s;
  for (((1) ? scanf("%d", &_) : EOF); _; _--, __++) {
    scanf("%d%d", &n, &m);
    cin >> s;
    if (n % m) {
      printf("-1\n");
      continue;
    }
    string ss = "", ans = "-1";
    if (check(s)) {
      ans = s;
    } else {
      for (int i = 0; i < 26; i++) num[i] = 0;
      for (auto c : s) {
        for (int nt = c - 'a' + 1; nt < 26; nt++) {
          int sum = 0, t = false;
          num[nt]++;
          for (int i = 0; i < 26; i++) sum += (num[i] + m - 1) / m * m;
          if (sum <= n) {
            ans = ss;
            ans += char(nt + 'a');
            for (int i = 0; i < 26; i++) {
              if (i == nt)
                for (int j = 1; j <= n - sum; j++) ans += char(nt + 'a');
              for (int j = 1; j <= (m - num[i] % m) % m; j++)
                ans += char(i + 'a');
            }
            t = true;
          }
          num[nt]--;
          if (t) break;
        }
        num[c - 'a']++;
        ss += c;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
