#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  string s;
  for (int i = 0; i < t; ++i) {
    int n;
    cin >> n;
    cin >> s;
    string s2 = s;
    string s3 = s;
    string s4 = "";
    sort(s2.begin(), s2.end());
    for (int j = 0, k = 0; j < n; ++j) {
      if (s[j] == s2[k]) {
        ++k;
        s4.push_back(s3[j]);
        s3[j] = 'r';
      }
    }
    for (int j = 0; j < n; ++j) {
      if (s3[j] != 'r') {
        s4.push_back(s3[j]);
        s3[j] = '2';
      } else {
        s3[j] = '1';
      }
    }
    if (s2 == s4) {
      cout << s3 << endl;
    } else {
      cout << "-" << endl;
    }
  }
  return 0;
}
