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 static java.lang.Math.*;

import java.util.*;

public class C {

	public Object solve () {
		int N = sc.nextInt(), K = sc.nextInt();
		String S = sc.next();

		if (N % K != 0)
			return -1;

		char [] A = S.toCharArray();
		int [] B = new int [26];

		for (int i : rep(N))
			++B[A[i] - 'a'];

		LinkedList<int[]> L = new LinkedList<>();

		for (int i : seq(N)) {
			int [] C = new int [26];
			int Z = 0;

			for (int j : rep(26))
				Z += C[j] = (int) (K * ceil(B[j], K) - B[j]);

			if (Z <= N-i) {
				boolean ok = true;
				LinkedList<int[]> U = new LinkedList<>(), V = new LinkedList<>();

				for (int j : rep(26)) {
					int [] u = { 'a' + j, C[j] };
					if (j == 25)
						u[1] += N-i-Z;
					if (u[1] > 0)
						U.addFirst(u);
				}

				for (int [] v : L)
					V.add(v.clone());

				int [] u = null, v = null;
				for (;;) {
					if (v == null) {
						if (V.isEmpty())
							break;
						v = V.poll();
					}

					if (u == null) {
						if (U.isEmpty()) {
							ok = false;
							break;
						}
						u = U.poll();
					}

					if (u[0] < v[0]) {
						ok = false;
						break;
					}

					if (u[0] > v[0])
						break;

					int m = min(u[1], v[1]);
					u[1] -= m; v[1] -= m;
					if (u[1] == 0)
						u = null;
					if (v[1] == 0)
						v = null;
				}

				if (ok) {
					String res = calc(A, i, C, S.toCharArray(), K, N-i-Z);
					return res;
				}
			}

			char c = A[i-1];
			--B[c - 'a'];
			if (L.isEmpty())
				L.add(new int [] { c, 1 });
			else {
				int [] v = L.peekFirst();
				if (v[0] == c)
					++v[1];
				else
					L.addFirst(new int [] { c, 1 });
				while (L.size() > 30)
					L.removeLast();
			}
		}

		throw new Error();
	}

	String calc (char [] A, int s, int [] C, char [] S, int K, int Y) {
		if (s == A.length)
			return new String(A);

		int j = S[s] - 'a';
		boolean D = false;

		if (C[j] == 0 && Y > 0) {
			D = true;
			C[j] += K;
			Y -= K;
		}

		if (C[j] > 0) {
			--C[j];
			String res = calc(A, s+1, C, S, K, Y);
			if (res != null)
				return res;
			++C[j];
		}

		if (D) {
			C[j] -= K;
			Y += K;
		}

		for (int i : rep(j+1, 26)) {
			if (C[i] == 0 && Y > 0) {
				C[i] += K;
				Y -= K;
			}
			if (C[i] > 0) {
				A[s] = (char) ('a' + i);
				--C[i];
				
				C[0] += Y;
				int m = 0;

				for (int t : rep(s+1, A.length)) {
					while (m < 26 && C[m] == 0)
						++m;
					A[t] = (char) ('a' + m);
					--C[m];
				}

				String res = new String(A);
				return res;
			}
		}

		return null;
	}

	private static final int CONTEST_TYPE = 2;

	private static void init () {
	}

	private static long ceil (long p, long q) { return Round.round(p, q, true); }
	private static int [] rep (int N) { return rep(0, N); }
	private static int [] rep (int S, int T) { if (S >= T) return new int [0]; int [] res = new int [T-S]; for (int i = S; i < T; ++i) res[i-S] = i; return res; }
	private static int [] sep (final int S, final int T) { if (S >= T) return new int [0]; int [] res = new int [T-S]; for (int i = S; i < T; ++i) res[T-1-i] = i; return res; }
	private static int [] seq (int N) { return seq(0, N); }
	private static int [] seq (int S, int T) { return sep(S, T+1); }
	private static class Round {
		private static long round (long p, long q, boolean up) {
			if (q < 0) return round(-p, -q, up);
			if (p < 0) return -round(-p, q, !up);
			return (p + (up ? q-1 : 0)) / q;
		}
	}
	//////////////////////////////////////////////////////////////////////////////////// OFF
	private static IOUtils.MyScanner sc = new IOUtils.MyScanner();
	private static class IOUtils {
		public static class MyScanner {
			public String next () { newLine(); return line[index++]; }
			public int nextInt () { return Integer.parseInt(next()); }
			//////////////////////////////////////////////
			private boolean eol () { return index == line.length; }
			private String readLine () {
				try {
					return r.readLine();
				} catch (Exception e) {
					throw new Error (e);
				}
			}
			private final java.io.BufferedReader r;
			private MyScanner () { this(new java.io.BufferedReader(new java.io.InputStreamReader(System.in))); }
			private MyScanner (java.io.BufferedReader r) {
				try {
					this.r = r;
					while (!r.ready())
						Thread.sleep(1);
					start();
				} catch (Exception e) {
					throw new Error(e);
				}
			}
			private String [] line;
			private int index;
			private void newLine () {
				if (line == null || eol()) {
					line = split(readLine());
					index = 0;
				}
			}
			private String [] split (String s) { return s.length() > 0 ? s.split(" ") : new String [0]; }
		}
		private static String build (Object o, Object ... A) { return buildDelim(" ", o, A); }
		private static String buildDelim (String delim, Object o, Object ... A) {
			StringBuilder b = new StringBuilder();
			append(b, o, delim);
			for (Object p : A)
				append(b, p, delim);
			return b.substring(min(b.length(), delim.length()));
		}
		//////////////////////////////////////////////////////////////////////////////////
		private static java.text.DecimalFormat formatter = new java.text.DecimalFormat("#.#########");
		private static void start () { if (t == 0) t = millis(); }
		private static void append (java.util.function.Consumer<Object> f, java.util.function.Consumer<Object> g, final Object o) {
			if (o.getClass().isArray()) {
				int len = java.lang.reflect.Array.getLength(o);
				for (int i = 0; i < len; ++i)
					f.accept(java.lang.reflect.Array.get(o, i));
			}
			else if (o instanceof Iterable<?>)
				((Iterable<?>)o).forEach(f::accept);
			else
				g.accept(o instanceof Double ? formatter.format(o) : o);
		}
		private static void append (final StringBuilder b, Object o, final String delim) {
			append(x -> { append(b, x, delim); }, x -> b.append(delim).append(x), o);
		}
		private static java.io.PrintWriter pw = new java.io.PrintWriter(System.out);
		private static void print (Object o, Object ... A) {
			String res = build(o, A);
			if (DEBUG == 2)
				err(res, '(', time(), ')');
			if (res.length() > 0)
				pw.println(res);
			if (DEBUG == 1) {
				pw.flush();
				System.out.flush();
			}
		}
		private static void err (Object o, Object ... A) { System.err.println(build(o, A)); }
		private static int DEBUG;
		private static void exit () {
			String end = "------------------" + System.lineSeparator() + time();
			switch(DEBUG) {
			case 1: print(end); break;
			case 2: err(end); break;
			}
			IOUtils.pw.close();
			System.out.flush();
			System.exit(0);
		}
		private static long t;
		private static long millis () { return System.currentTimeMillis(); }
		private static String time () { return "Time: " + (millis() - t) / 1000.0; }
		private static void run (int N) {
			try { DEBUG = Integer.parseInt(System.getProperties().get("DEBUG").toString()); }
			catch (Throwable t) {}

			for (int n = 1; n <= N; ++n) {
				Object res = new C().solve();
				if (res != null) {
					@SuppressWarnings("all")
					Object o = CONTEST_TYPE == 0 ? "Case #" + n + ": " + build(res) : res;
					print(o);
				}
			}
			exit();
		}
	}
	////////////////////////////////////////////////////////////////////////////////////
	public static void main (String[] args) {
		init();
		@SuppressWarnings("all")
		int N = CONTEST_TYPE == 1 ? 1 : sc.nextInt();
		IOUtils.run(N);
	}
}
