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

#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  string a;
  while (t--) {
    int n, m;
    cin >> n >> m;
    cin >> a;
    int num = 0;
    for (int i = 0; i < num; i++) {
      if (a[i] == 'z') {
        num++;
      }
    }
    if (n % m != 0) {
      cout << -1 << endl;
    } else if (num == n) {
      cout << -1 << endl;
    } else {
      for (int i = 0; i < n; i++) {
        cout << 'z';
      }
      cout << endl;
    }
  }
  return 0;
}
