#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int t;
  cin >> t;
  while (t--) {
    int n, m = 0;
    string s, r, q;
    cin >> n >> s;
    r = s;
    q = s;
    sort(r.begin(), r.end());
    int idx = 0;
    for (int i = 0; i < n; i++) {
      if (r[idx] == s[i]) {
        idx++;
        q[i] = '1';
        m++;
      }
    }
    for (int i = 0; i < n; i++) {
      if (r[idx] == s[i]) {
        idx++;
        q[i] = '2';
        m++;
      }
    }
    if (n == m)
      cout << q << endl;
    else
      cout << '-' << endl;
  }
  return EXIT_SUCCESS;
}
