#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s, tmp;
    cin >> s;
    tmp = s;
    string ans = s;
    int op = 0;
    sort(tmp.begin(), tmp.end());
    for (int i = 0; i < n; i++)
      if (s[i] == tmp[op]) {
        ans[i] = '1';
        op++;
      }
    for (int i = 0; i < n; i++) {
      if (s[i] == tmp[op]) {
        ans[i] = '2';
        op++;
      }
    }
    if (op != n)
      cout << '-' << endl;
    else
      cout << ans << endl;
  }
}
