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

def solve(n, k, s):
    answer = ''
    cnt = 0
    dc = [0] * 26 + [n]
    while cnt < n:
        if dc[ord(s[cnt]) - ord('a')] > 0:
            dc[ord(s[cnt]) - ord('a')] -= 1
        elif dc[26] > 0:
            dc[26] -= k
            dc[ord(s[cnt]) - ord('a')] = k - 1
        else:
            break
        answer += s[cnt]
        cnt += 1
    if cnt == n:
        print(answer)
        return
    sd = -1
    for i in range(ord(s[cnt]) - ord('a'), 26):
        if dc[i] > 0:
            sd = i
            break
    if sd >= 0:
        answer += chr(ord('a') + sd)
        dc[sd] -= 1
        for i in range(26):
            answer += chr(ord('a') + i) * dc[i]
        print(answer)
        return
    cnt -= 1
    while True:
        dc[ord(s[cnt]) - ord('a')] += 1
        if dc[ord(s[cnt]) - ord('a')] == k:
            dc[ord(s[cnt]) - ord('a')] = 0
            dc[26] = k
        if s[cnt] != 'z' and dc[26] > 0:
            break
        cnt -= 1
    answer = answer[:cnt]
    answer += chr(ord(s[cnt]) + 1)
    if dc[ord(s[cnt]) - ord('a') + 1] > 0:
        dc[ord(s[cnt]) - ord('a') + 1] -= 1
    else:
        dc[ord(s[cnt]) - ord('a') + 1] = k - 1
        dc[26] -= k
    dc[0] += dc[26]
    dc[26] = 0
    for i in range(26):
        answer += chr(ord('a') + i) * dc[i]
    print(answer)
    return


def sol():
    n, k = map(int, input().split())
    s = input()
    if n % k != 0:
        print(-1)
        return
    solve(n, k, s)


for iter in range(int(input())):
    sol()
