#include <bits/stdc++.h>
using namespace std;
int a[200100];
int main() {
  int n, i, j, k, t;
  string s, p, ss;
  cin >> t;
  while (t--) {
    cin >> n >> s;
    ss = s;
    sort(ss.begin(), ss.end());
    int ii = 0;
    for (i = 0; i < n; i++) {
      if (s[i] == ss[ii]) {
        a[i] = 1;
        ii++;
      }
    }
    for (i = 0; i < n; i++) {
      if (s[i] == ss[ii]) {
        a[i] = 2;
        ii++;
      }
    }
    if (ii == n) {
      for (i = 0; i < n; i++) cout << a[i];
      cout << "\n";
    } else {
      cout << "-\n";
    }
  }
}
