#include <bits/stdc++.h>
using namespace std;
int book[200050];
int main() {
  int n;
  cin >> n;
  string s, t;
  while (n--) {
    int num = 0;
    memset(book, 0, sizeof(book));
    int nn;
    cin >> nn;
    cin >> s;
    t = s;
    sort(t.begin(), t.end());
    int k = 0;
    for (int i = 0; i < nn; i++) {
      if (s[i] == t[k]) {
        book[i] = 1;
        num++;
        k++;
      }
    }
    for (int i = 0; i < nn; i++) {
      if (!book[i] && s[i] == t[k]) {
        book[i] = 2;
        num++;
        k++;
      }
    }
    if (num != nn)
      puts("-");
    else {
      for (int i = 0; i < nn; i++) printf("%d", book[i]);
    }
    puts("");
  }
  return 0;
}
