You are given a string s consisting of lowercase English letters and a number k. Let's call a string consisting of lowercase English letters beautiful if the number of occurrences of each letter in that string is divisible by k. You are asked to find the lexicographically smallest beautiful string of length n, which is lexicographically greater or equal to string s. If such a string does not exist, output -1.

A string a is lexicographically smaller than a string b if and only if one of the following holds: 

  * a is a prefix of b, but a ≠ b; 
  * in the first position where a and b differ, the string a has a letter that appears earlier in the alphabet than the corresponding letter in b. 

Input

The first line contains a single integer T (1 ≤ T ≤ 10 000) — the number of test cases.

The next 2 ⋅ T lines contain the description of test cases. The description of each test case consists of two lines.

The first line of the description contains two integers n and k (1 ≤ k ≤ n ≤ 10^5) — the length of string s and number k respectively.

The second line contains string s consisting of lowercase English letters.

It is guaranteed that the sum of n over all test cases does not exceed 10^5.

Output

For each test case output in a separate line lexicographically smallest beautiful string of length n, which is greater or equal to string s, or -1 if such a string does not exist.

Example

Input


4
4 2
abcd
3 1
abc
4 3
aaaa
9 3
abaabaaaa


Output


acac
abc
-1
abaabaaab

Note

In the first test case "acac" is greater than or equal to s, and each letter appears 2 or 0 times in it, so it is beautiful.

In the second test case each letter appears 0 or 1 times in s, so s itself is the answer.

We can show that there is no suitable string in the third test case.

In the fourth test case each letter appears 0, 3, or 6 times in "abaabaaab". All these integers are divisible by 3.
import collections
import string
import math
import copy
import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)


def input(): return sys.stdin.readline().rstrip("\r\n")


# n = 0
# m = 0

# n = int(input())

# li = [int(i) for i in input().split()]

# s = sorted(li)
"""
from dataclasses import dataclass

@dataclass
class point:
    x: float
    y: float
 
 
@dataclass
class line:
    A: float
    B: float
    C: float
 
    def gety(self, x):
        return (self.A*x+self.C)/-self.B
    
    def getx(self, y):
        return (self.B*y+self.C)/-self.A
 
    def k(self):
        return -self.A/self.B
 
    def b(self):
        return -self.C/self.B
 
    def dist(self, p: point):
        return abs((self.A*p.x+self.B*p.y+self.C)/(self.A**2+self.B**2)**0.5)
 
 
def calc_line(u: point, v: point):
    return line(A=u.y-v.y, B=v.x-u.x, C=u.y*(u.x-v.x)-u.x*(u.y-v.y))
 
 
def is_parallel(u: line, v: line) -> bool:
    f1 = False
    f2 = False
    try:
        k1 = u.k()
    except:
        f1 = True
    try:
        k2 = v.k()
    except:
        f2 = True
    if f1 != f2:
        return False
    return f1 or k1 == k2
 
 
def seg_len(_from: point, _to: point):
    return ((_from.x - _to.x)**2 + (_from.y - _to.y)**2) ** 0.5
 
def in_range(_from: point, _to: point, _point: point) -> bool:
    if _from.x < _to.x:
        if _from.y < _to.y:
            return _from.x <= _point.x <= _to.x and _from.y <= _point.y <= _to.y
        else:
            return _from.x <= _point.x <= _to.x and _from.y >= _point.y >= _to.y
    else:
        if _from.y < _to.y:
            return _from.x >= _point.x >= _to.x and _from.y <= _point.y <= _to.y
        else:
            return _from.x >= _point.x >= _to.x and _from.y >= _point.y >= _to.y
 
def intersect(u: line, v: line) -> point:
    tx = (u.B*v.C-v.B*u.C)/(v.B*u.A-u.B*v.A)
    if u.B!=0.0:
        ty = -u.A*tx/u.B - u.C/u.B
    else:
        ty = -v.A*tx/v.B - v.C/v.B
    return point(x=tx, y=ty)
 
def in_direction(_from: point, _to: point, _point: point) -> bool:
    if _from.x < _to.x:
        if _from.y < _to.y:
            return _to.x < _point.x  and _to.y < _point.y
        else:
            return _to.x < _point.x  and _point.y <= _to.y
    else:
        if _from.y < _to.y:
            return _to.x >= _point.x  and _to.y < _point.y
        else:
            return _to.x >= _point.x  and _point.y <= _to.y


"""
mo = 998244353


def exgcd(a, b):
    if not b:
        return 1, 0
    y, x = exgcd(b, a % b)
    y -= a//b * x
    return x, y


def getinv(a, m):
    x, y = exgcd(a, m)
    return -1 if x == 1 else x % m


def comb(n, b):
    res = 1
    b = min(b, n-b)
    for i in range(b):
        res = res*(n-i)*getinv(i+1, mo) % mo
        # res %= mo
    return res % mo


def quickpower(a, n):
    res = 1
    while n:
        if n & 1:
            res = res * a % mo
        n >>= 1
        a = a*a % mo
    return res


def dis(a, b):
    return abs(a[0]-b[0]) + abs(a[1]-b[1])


def getpref(x):
    if x > 1:
        return (x)*(x-1) >> 1
    else:
        return 0


def orafli(upp):
    primes = []
    marked = [False for i in range(upp+3)]
    for i in range(2, upp):
        if not marked[i]:
            primes.append(i)
        for j in primes:
            if i*j >= upp:
                break
            marked[i*j] = True
            if i % j == 0:
                break
    return primes


def read_list():
    return [int(i) for i in input().split()]


def read_int():
    s = input().split()
    if len(s) == 1:
        return int(s)
    else:
        return map(int, s)


def ask(s):
    print(f"? {s}", flush=True)


def answer(s):
    print(f"! {s}", flush=True)



mp = {
    '8':'8',
    '2':'5',
    '0':'0',
    '1':'1',
    '5':'2'
}

us = {
    '3','4','6','7','9'
}

def solve():
    n, k = read_int()

    s = input()
    if n % k != 0:
        print(-1)
        return
    d = [0 for i in range(26)]

    for p, i in enumerate(s):
        d[ord(i)-97] += 1
        # d[ord(i)-97] %= k

    d2 = [0 for i in range(26)]
    valid = None
    def reve():
        d3 = [0 for i in range(26)]
        for p, i in enumerate(d):
            d3[p] = (-i)%k
        return d3

    dd = reve()
    if sum(dd) == 0:
        print(s)
        return

    for p, i in enumerate(s[::-1]):
        d[ord(i)-97]-=1
        for j in range((ord(i)-97)+1, 26):
            d[j]+=1
            dd = reve()
            sd = sum(dd)
            if sd <= p and (p - sd)%k==0:
                bck = []
                for k, v in enumerate(dd[::-1]):
                    bck.append(chr(97+25-k)*v)
                bck.append('a'*(p - sd))
                bck.reverse()
                print(s[:-p-1] + chr(97+j) + ''.join(bck))
                return

            d[j]-=1
        # for j in range(26):
        #     d3[j] = d1[j] - d2[j]

            
        # d2[i] = d2.get(i, 0) + 1
        # d2[ord(i)-97] += 1
        # d2[ord(i)-97] %= k

    print(-1)

# solve()
t = int(input())

for ti in range(t):
    # print(f"Case #{ti+1}: ",end='')
    solve()
