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

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
	public static void main (String[] args) throws java.lang.Exception
	{
		FastReader scan = new FastReader();
		PrintWriter pw = new PrintWriter(System.out);
		int t = scan.nextInt();
		while(t-->0){
		    int n = scan.nextInt();
		    int k = scan.nextInt();
		    String str = scan.next();
		    if(n%k != 0)
        {  pw.println(-1);
        pw.flush();
            continue;
        }
            int flag=1;
		    
		    int a[] = new int[26];
		    for(int i=0;i<str.length();i++){
		        a[str.charAt(i)-'a']++;
		    }
		    int count=0;
		    for(int i=0;i<26;i++){
		        count+=fun(a[i],k);
		    }
		    if(count==0){
		    pw.println(str);
		    pw.flush();
		    continue;
		    }
		    int i = n-1;
		    while(count>0){
		        int j = str.charAt(i) - 'a';
		        count-=fun(a[j],k);
		        a[j]--;
		        count+=fun(a[j],k);
		        int last_count = count;
		        for(int l=j+1;l<26;l++){
		            count-=fun(a[l],k);
		            a[l]++;
		            count+=fun(a[l],k);
		            if(count+i+1<=n){
		                for(int p=0;p<i;p++)
		                pw.print(str.charAt(p));
		                pw.print((char)(l+'a'));
		                String extra="";
		                for(int m=0;m<26;m++){
		                    for(int M=1;M<=fun(a[m],k);M++){
		                        extra+=(char)('a'+m);
		                    }
		                }
		                while(i+1+extra.length()<n)
		                extra = "a"+extra;
		                pw.print(extra);
		                flag=0;
		                break;
		            }
		            a[l]--;
		            count = last_count;
		        }
		        if(flag==0)
		        break;
		        i--;
		    }
		    
		    pw.println();
		   pw.flush(); 
		}
	}
	static int fun(int x, int k){
	    return ((k-x%k)%k);
	}
}
