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

 ######      ###      #######    #######    ##      #     #####        ###     ##### 
 #     #    #   #          #        #       # #     #    #     #      #   #     ###  
 #     #   #     #        #         #       #  #    #   #       #    #     #    ###  
 ######   #########      #          #       #   #   #   #           #########    #   
 ######   #########     #           #       #    #  #   #           #########    #   
 #     #  #       #    #            #       #     # #   #    ####   #       #    #   
 #     #  #       #   #             #       #      ##   #    #  #   #       #        
 ######   #       #  #######     #######    #       #    #####  #   #       #    #   
 
# from __future__ import print_function # for PyPy2
# from itertools import permutations as perm
# from fractions import Fraction
from collections import *
from sys import stdin
from bisect import *
# from heapq import *
from math import *
 
g   = lambda : stdin.readline().strip()
gl  = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1e9)+7
inf = float("inf")

t, = gil()

def solved(s, k):
	for v in Counter(s).values():
		if v%k: return False
	return True

def getNextChar(ch):
	return chr(ord(ch)+1)

def solve():
	n, k = gil()
	s = gcl()
	if n%k : return -1
	if k == 1 or solved(s, k): return ''.join(s)

	reqSum = 0
	req = {}
	char, idx = None, None

	for i in range(n):
		ch = s[i]
		right = n-i-1

		tempChar = getNextChar(ch)
		while tempChar != '{':
			delta = 0
			if tempChar in req:
				delta = req[tempChar] - 1 
				if delta < 0 : delta = k-1
			else:
				delta = k-1

			if reqSum + delta <= right:
				idx = i
				char = tempChar
				break

			tempChar = getNextChar(tempChar)

		# update the requiremnts
		delta = 0
		if ch in req:
			re = req[ch]
			delta -= re
			re -= 1
			if re < 0 : re = k-1
			delta += re
			req[ch] = re
		else:
			req[ch] = k-1
			delta = k-1

		reqSum += delta

	if reqSum == 0: return ''.join(s)

	s[idx] = char

	s = s[:idx+1] 
	b = Counter(s)
	for ch in b:
		b[ch] = (k - (b[ch]%k))%k

	sm = sum(b.values())
	rt = n-idx-1
	extra = rt - sm

	b['a'] = b.get('a', 0) + extra

	for ch in 'abcdefghijklmnopqrstuvwxyz':
		s.append(ch*b[ch])

	return ''.join(s)



for _ in range(t):
	print(solve())


